aspose file tools*
The moose likes Beginning Java and the fly likes Images don't appear in Swing code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Images don Watch "Images don New topic
Author

Images don't appear in Swing code

Vonique Leary
Ranch Hand

Joined: Mar 24, 2008
Posts: 107
The following code is from Java In Easy Steps:




It is downloaded exactly from the book but no juggler appears and I can't figure out why.

http://www.ineasysteps.com/books/details/?1840780258 here are the images to get the pictures if anyone is interested in trying out the code.

Thanks,
Vonique


Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 563
I see you've commented out your main() method, which I assume is what you used to test the class. Explain what's going on there.

Also, the same main() method instantiates a Juggler object, jug, using the constructor Juggler(). You don't have a Juggler object defined or a constructor Juggler(). Are you sure you copied it directly from the book example? It doesn't make sense. Class names are capitalized by convention, which makes me think you've modified the book code, OR the book is non-standard.


Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Vonique Leary
Ranch Hand

Joined: Mar 24, 2008
Posts: 107
Never mind. Figured it out already. Thanks anyway!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40034
    
  28
Nice to see you again Please tell us how you sorted it out, because others might have the same problem in future.
Vonique Leary
Ranch Hand

Joined: Mar 24, 2008
Posts: 107
Hi Campbell,

Well, it was just a case of not studying it adequately because there were a few labels and buttons missing. Those simple things were revealed upon closer inspection.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40034
    
  28
Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Images don't appear in Swing code