Disabled Component Colors

Is there a way to over ride the default disabled component colors?

1 Like

There are some components that have properties to change the disabled/non-editable colors, but other than that you can’t change the colors of disabled components.

Could he leverage Java’s UIManager? I’ve used it before with other Java products to alter the appearance of controls in certain states …

UIManager.put("ScrollBar.width", 40);
UIManager.put("FormattedTextField.inactiveBackground", new ColorUIResource(0,0,0));

See: http://edn.embarcadero.com/article/29991

Yeah, you could use the UI manager, but I’m not familiar enough with it to give a concrete example. Many things are possible in Ignition, this one just isn’t baked in.

@Joseph If you can provide exactly what you wish to manipulate, I can take a whirl at it and see if I can help.

1 Like

The momentary button and the numeric text field to a darker grey when the components are disabled.

Ok, I can get you close to what you want, can’t figure out the Button’s disabled background though. I added the following within Event Scripts (Client)

from javax.swing import UIManager
from javax.swing.plaf import ColorUIResource

UIManager.put("Button.disabledText", ColorUIResource(0,255,255));
UIManager.put("FormattedTextField.inactiveForeground", ColorUIResource(0,255,255));
UIManager.put("FormattedTextField.inactiveBackground", ColorUIResource(0,38,255));

With this snippet, I get the following results …

As you see in the example above, using UIManager affects all controls which utilize these properties, not just the ones you mentioned. If you want to explore other properties, check out the applet provided at this link.

Hope it helps!

Thanks Bryan. This is totally new to me so it’ll require some probing.

Did you make it work?

Would be nice to have a reference to the Java object definitions for components. I’m now trying to do the same thing with the tank text color and label text color, but I don’t know the object name/properties syntax.