aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Setting Look and feel for one component type Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Setting Look and feel for one component type" Watch "Setting Look and feel for one component type" New topic
Author

Setting Look and feel for one component type

Xander Martin
Greenhorn

Joined: Jul 11, 2012
Posts: 2
Hey,

I have set my entire application to use the Nimbus look and feel. However, the designer feels the way combo boxes look aren't right, so he wants them reset back to the default look and feel. Anyone ever managed to set the look and feel for one component type?

I've tried the obvious ones of calling getLookfAndFeelDefaults().clone() before setting the nimbus LaF and going through each nimbus default key and setting it to the returned value.


Does change it, but not back to the defaults. I think because it can't find a value, it goes blank and produces some very funky looking ComboBoxes.

I also tried setting ComboBox and ComboBoxUI but to no avail.

Any ideas?

Thanks.
Xander Martin
Greenhorn

Joined: Jul 11, 2012
Posts: 2
Calling .setUI() on components and passing a new L&F works nicely. Glad my combo box is a custom component so i just inserted it into the constructor.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Setting Look and feel for one component type
 
Similar Threads
JRadioButton in JTable
JSlider knob color
JEditorPane - background color not properly set when changing metal color theme
JFileChooser modification
question about background colors in jtabbedpane