• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to change JFileChooser's title bar icon?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was it!
Thank you very much Chella
Branko.
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic