This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFrame doesnt display image until it is resized

 
Sanjeev Mehta
Greenhorn
Posts: 26
  • 0
  • 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: 2475
8
  • 0
  • 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
  • 0
  • 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: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lazy Me wrote:

Please check your private messages for an important administrative matter
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic