aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How To Change the Title Icon of JoptionPane/dialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How To Change the Title Icon of JoptionPane/dialog" Watch "How To Change the Title Icon of JoptionPane/dialog" New topic
Author

How To Change the Title Icon of JoptionPane/dialog

Ravi Sinha
Greenhorn

Joined: Nov 04, 2003
Posts: 13
Hi There!
There is code for chaning the title Icon of Frame:
ImageIcon image = new ImageIcon("hello.gif");
JOptionPane.setIcon(image.getImage());
But i want to change the Title Icon of Joptionpane or Dialog? How can i chane it. pleeez give code for this.
Thanks
ravi
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

JDialogs (and I assume JOptionPane, since they are internally using JDialog), use the icon from the frame that is their parent. So you just need to set the icon on the parent frame and then pass the frame into the constructor of the JDialog for the JDialog to use the same icon.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To Change the Title Icon of JoptionPane/dialog