This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Add TIF image to Jlist or Frame in java  RSS feed

 
ashish donvir
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to load a .TIF formatted image to add into Jlist and display it into frame. Here is My code what i tried, here though the image is loaded my frame still looks empty and doesn't showing anything. please correct my code or suggest me that what should be the change i have to make display my .TIF image.

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you drag the frame a little wider, does the image now appear?
 
ashish donvir
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Michael it appears on dragging the frame, thanks. but why it is not appearing directly on my frame in fact letter-on i even add jScrollPane to frame though it doesn't showing.
what should i change to show it directly. i guess its a problem of size. How to control this thing?

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make the JFrame#setVisible the last call in the main method.
 
ashish donvir
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its done. thank you very much
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!