• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to set icon on the non resizable jdialog

 
shashikant kulkarni
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to create dialog with icon on the top left corner and also this dialog should be non resizable.
Thanks Regards..
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, for the resize you would call setResizable( false ) on the JDialog... As for the icon, JDialog inherits that from whatever frame launched it, so you'll have to set the icon of the JFrame using frame.setIconImage( icon ) and then create the dialog by passing the frame into it's constructor.

-Nate
 
shashikant kulkarni
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nathan
Accroding to your solution, problem still remains.When you call setResizable(false) on the JDialog, the icon will not display on the JDialog.
Sanjay
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whoops! Sorry... though I did find a mention of this on Sun's site... http://developer.java.sun.com/developer/bugParade/bugs/4094035.html

It says it's a feature... not a bug!

-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!