JLabel
ラベルのテキストの上にアイコンを表示しようとしています。
現在、私は次のコードを持っています。
URL loc = null;
ImageIcon img = null;
JLabel label = null;
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
loc = Test.class.getResource("/Images/imageName.jpg");
img = new ImageIcon(loc);
label = new JLabel("someText", img, JLabel.CENTER);
label.setIconTextGap(0);
label.setVerticalTextPosition(JLabel.BOTTOM);
label.setHorizontalTextPosition(JLabel.RIGHT);
frame.getContentPane().add(label);
現在表示されている出力は、画像アイコンの右側にあるラベルテキストです。誰かが何を変更するかを提案できますか?