• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Images don't appear in Swing code

 
Vonique Leary
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vonique Leary
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind. Figured it out already. Thanks anyway!
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic