In the default LAFs, if you put a form in readOnly mode (form.controller.readOnly = true) then an annoying thing happens to your comboboxes - they become difficult to read because they become grey text against a grey background like so:
[attachment=1]4-29-2010 2-23-52 PM.png[/attachment]
This is the OS’s way of signalling to the user that the combobox is not ‘active’ at the moment. It would be nice if we could achieve that without making the data hard to read. Well Sanneke Aleman sent me this line of code which ensures that the text will remain black even if the background goes gray:
application.setUIProperty("ComboBox.disabledForeground", new Packages.javax.swing.plaf.ColorUIResource(java.awt.Color.BLACK));
Now the comboboxes on a readOnly form look like this:
[attachment=0]4-29-2010 2-30-09 PM #2.png[/attachment]
Much better! Thank you Sanneke!