Question

I like to change the UI of a JComboBox from the default metal look to some custom UI, see attached image.

Sample

I have tried changing all the UIDefaults for the JComboBox but to no success.

How does one achieve this?

jdk1.4.2

Was it helpful?

Solution

You have to write your own ComboBoxUI class. I suggest to look at either Synth or Nimbus Look and Feel to make it easier.

OTHER TIPS

you need to change arrow image , and in style change background for this JComboBox !

use WindowsLookAndFeel;

this works if and only if you are running your application in winows;

in your main you can do this before creating any UI:


try{
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}catch(Exception ignore){
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top