1
シンセxmlファイル内のJLabelのアイコンを設定しようとしていますが、表示されません。私はdefaultIconとiconプロパティの両方を設定しようとしましたが、何もしていないようです。私はここでJLabel以外の何かを使うべきですか?ここに私のコードがあります:Synth xmlのJLabelアイコンを設定する
<style id="dayBgLabelStyle">
<imageIcon id="bg" path="images/WG_selectionFields-2.png"/>
<property key="defaultIcon" value="bg"/>
<property key="icon" value="bg"/>
</style>
<bind style="dayBgLabelStyle" type="name" key="dayBgLabel"/>
JLabel dayBgLabel = new JLabel();
dayBgLabel.setName("dayBgLabel");
dayBgLabel.setIcon(createImageIcon("images/selectionFields-2.png"));
protected static ImageIcon createImageIcon(String path) {
java.net.URL imgURL = testClass.class.getResource(path);
if (imgURL != null)
return new ImageIcon(imgURL);
else
return null;
}
あなたが作成したシンセスタイルの綴じ線を追加できますか? – Joshua