- This topic has 4 replies, 3 voices, and was last updated 17 years, 10 months ago by Riyad Kalla.
-
AuthorPosts
-
smulgundMemberMy project contains Sun’s jlfgr-1.0.jar file, which contains numerous icons for buttons. Within my own code, I can add a button icon thusly:
button.setIcon( new ImageIcon(MainWindow.class.getResource(“/toolbarButtonGraphics/general/Import24.gif” )) );
where “MainWindow” is my subclass of JFrame containing the various widgets I need.
How do I do the same thing from within Matisse? I tried selecting the “icon” field in the properties browser, but none of the options allow me to specify “/toolbarButtonGraphics/general/Import24.gif” as the source of the icon. Is there a project setting I need somewhere else for the GUI builder to recognize that this resource is part of the build path?
Thanks
Sandeep
Riyad KallaMemberSandeep, this is a bug. You should be able to select JAR file contents here as a resource, I just filed this. The code in order to load from your classpath should look like this:
new javax.swing.ImageIcon(getClass().getResource("/edu/arizona/econlab/edgeworth/resource/esllogonew.gif"))
Sorry for the inconvenience.
smulgundMemberThanks for looking into this. For the moment I guess I’ll just use my own initialization code after the machine-generated method is invoked. If you can fix this bug and the issue of the disappearing palette (related to network access evidently), I’ll be a happy man!
Sandeep
@support-rkalla wrote:
Sandeep, this is a bug. You should be able to select JAR file contents here as a resource, I just filed this. The code in order to load from your classpath should look like this:
new javax.swing.ImageIcon(getClass().getResource("/edu/arizona/econlab/edgeworth/resource/esllogonew.gif"))
Sorry for the inconvenience.
Claye GreeneMemberDoes anyone know if this has been resolved yet?
If I want to work around the issue, I’m assuming I can use the format of the code snippet to load an icon from my jar file?
Riyad KallaMemberEyalc,
I thought this had gotten fixed in 5.0 or 5.1, which version ar eyou using? Can you explain your specific use-case to me so I can test it out here? -
AuthorPosts