Usage of GUIUtilities.loadIcon
Submitted by Saturday, 17 May, 2008 - 14:13
on
Hi folks,
I am trying to modify the QuickNotepad sources to add an extra button to the tool panel (QuickNotepadToolPanel.java) but whatever I do I can't seem to load a PNG file as the button icon.
I've added the following bit to QuickNotepadToolPanel.java to add the actual button:
add(makeCustomButton("msp430.foo", new ActionListener() {
public void actionPerformed(ActionEvent evt) {
QuickNotepadToolPanel.this.pad.foo();
}
}));
..and I have specified the icon files in the props file as:
QuickNotepad.foo.icon=foo.png
QuickNotepad.foo.label=Foo
the icon foo.png resides in the same folder as the java sources and the code compiles just fine but the icon is not loaded when I load the plugin and the button is just the size of a tiny dot.
If I specify an absolute path the code compiles but jEdit chokes on startup and I have to kill it.
Do I need to somehow specify the icon location in the build.xml file? Can I manually add the files to the jar itself?
Quite an easy question I guess but it has been driving me crazy so any comments/help much appreciated.
Cheers,
Hamza.
I am trying to modify the QuickNotepad sources to add an extra button to the tool panel (QuickNotepadToolPanel.java) but whatever I do I can't seem to load a PNG file as the button icon.
I've added the following bit to QuickNotepadToolPanel.java to add the actual button:
add(makeCustomButton("msp430.foo", new ActionListener() {
public void actionPerformed(ActionEvent evt) {
QuickNotepadToolPanel.this.pad.foo();
}
}));
..and I have specified the icon files in the props file as:
QuickNotepad.foo.icon=foo.png
QuickNotepad.foo.label=Foo
the icon foo.png resides in the same folder as the java sources and the code compiles just fine but the icon is not loaded when I load the plugin and the button is just the size of a tiny dot.
If I specify an absolute path the code compiles but jEdit chokes on startup and I have to kill it.
Do I need to somehow specify the icon location in the build.xml file? Can I manually add the files to the jar itself?
Quite an easy question I guess but it has been driving me crazy so any comments/help much appreciated.
Cheers,
Hamza.