This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFrame doesnt display image until it is resized

 
Sanjeev Mehta
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a simple code with a JFrame displaying an image. The problem I am facing is that the image does not appear when I execute the code. At first the JFrame is blank. If I now resize the JFrame, the image is displayed. Could you guys help me figure out the problem please.

Please find my code below
 
Rob Camick
Ranch Hand
Posts: 2616
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works fine for me using JDK6 on XP.

Why don't you read the section from the Swing tutorial on "How to Use Icons" and download the example from there to see if it works properly in your environment.
 
Sanjeev Mehta
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was on JDK5. Upgraded to JDK 6 now and it works fine.
Thanks.
 
Maneesh Godbole
Saloon Keeper
Posts: 11185
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lazy Me wrote:

Please check your private messages for an important administrative matter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic