• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nonmodal window showing image

 
Norm Radder
Bartender
Posts: 1340
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an app that displays a question in a textarea and choices of answers in a list. Some of the questions have an image associated with them.
I don't normally use Swing classes, but in this case I thought they'd be useful.

What class(es) can I use to show an image in a non-modal window?
I want to display the window with an image when the associated question is being asked and dispose of it when the user moves on to the next question.

Thanks,
Norm
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use javax.swing.JLabel + javax.swing.ImageIcon:

This should probably be in the Swing forum.
 
Norm Radder
Bartender
Posts: 1340
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff,
Thanks!
The only change I needed was to use Class getResource() to run it from a jar file. And to remove the Exit on close.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic