how can i change color of disabled jcombox
Hi is there any way to change default color when JComboBox is setEnabled false?
I used Nimbus Look and feel.. It seems that it doesnt fit my design the default color of grey when it is disabled... how can I change the default color of disabled JComboBox?
Re: how can i change color of disabled jcombox
this does not work and I'm suprised that it seems to be working for you, are you sure the background wasn't already blue?
Originally Posted by ra4king
I searched many forums for an answer to this as I had no luck with standard setForeground methods etc and changing the UImanager either as .put or getDefaults().put did not work.
the only solution I found that worked - and it's quite simple was
((JTextField) comboBox.getEditor().getEditorComponent()).setDisa bledTextColor(Color.#####);
apparently this is only supposed to work for enabled boxes but it worked for my disabled boxes perfectly and can be done befoer or after the box enabled is set to false
i can see from the time stamps that you most likely don't need or care about this anymore but thought I'd post it to make it easier for anyone else searching for a solution