Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to change JFileChooser's title bar icon?  RSS feed

 
Branko Paskutini
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, would someone be able to tell me how to change JFileChooser's title bar icon? Something similar to java.awt.Frame's setIconImage(). I also had a look at all the options for UIManager.put for FileChooser and couldn't find anything.
It seems all the other components have UI value and can therefore be modified, except title bar icon? At least I cannot see it when I run this code:

For example, I've noticed there is an UI entry for the open dialog title bar text (FileChooser.openDialogTitleText), and that one can also be modified with the JFileChooser's setDialogTitle(String) method. So I am trying to find out a way to do the same with the title bar icon. Programmatically, or by setting UI value, I don't care.
I am using JDK 1.3.1 SE.
TIA, Branko.
 
Chella Anu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get the customized icon in JFileChooser title:
Get the instance of JFrame, set image icon for the JFrame, then just by passing this JFrame to filechooser component the Icon would get reflected for JFileChooser also.
JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(frm);
 
Branko Paskutini
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was it!
Thank you very much Chella
Branko.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!