This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Modify your code from cancel = new JCheckBox("Cancel PO",new ImageIcon(getClass().getResource(ApplicationConstants.cancel)));
cancel = new JCheckBox("Cancel PO",new ImageIcon(getClass().getClassLoader().getResource(ApplicationConstants.cancel)));
you have to the get the classloader to load the images
Joined: Feb 28, 2001
Thanks for the response! I haven't tried that yet, but did find something interesting (and weird). I tried all of my other images that I had in Eclipse and they all worked with the code that I currently have. I could not think of anything else, so just for craps and giggles, I renamed the image from cancel.jpg to redx.jpg, then exported it to a jar file and it worked! Not sure why, though. That'll be something to ponder later this week. Thanks again!