# Disabled Component Colors

**URL:** <https://forum.inductiveautomation.com/t/disabled-component-colors/3927>\
**Category:** Ignition\
**Created:** [January 27, 2012, 11:01pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927 "2012-01-27T23:01:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_Mendonca](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Joseph\_Mendonca](https://forum.inductiveautomation.com/u/Joseph_Mendonca)\
**Post date:** [January 27, 2012, 11:01pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/1 "2012-01-27T23:01:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [January 31, 2012, 4:26pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/2 "2012-01-31T16:26:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bryan\_cook](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@bryan\_cook](https://forum.inductiveautomation.com/u/bryan_cook)\
**Post date:** [January 31, 2012, 4:48pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/3 "2012-01-31T16:48:29Z")

</div>

Could he leverage Java’s [UIManager](http://docs.oracle.com/javase/6/docs/api/javax/swing/UIManager.html)? I’ve used it before with other Java products to alter the appearance of controls in certain states …

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

See: [http://edn.embarcadero.com/article/29991](http://edn.embarcadero.com/article/29991)

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [January 31, 2012, 5:12pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/4 "2012-01-31T17:12:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bryan\_cook](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@bryan\_cook](https://forum.inductiveautomation.com/u/bryan_cook)\
**Post date:** [January 31, 2012, 9:32pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/5 "2012-01-31T21:32:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Joseph\_Mendonca](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Joseph\_Mendonca](https://forum.inductiveautomation.com/u/Joseph_Mendonca)\
**Post date:** [January 31, 2012, 10:41pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/6 "2012-01-31T22:41:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bryan\_cook](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@bryan\_cook](https://forum.inductiveautomation.com/u/bryan_cook)\
**Post date:** [February 1, 2012, 1:30am UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/7 "2012-02-01T01:30:02Z")

</div>

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) …

```auto
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](http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/).

Hope it helps!

---

<div class="post-metadata">

**Author:** ![Joseph\_Mendonca](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Joseph\_Mendonca](https://forum.inductiveautomation.com/u/Joseph_Mendonca)\
**Post date:** [February 1, 2012, 4:57pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/8 "2012-02-01T16:57:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [March 19, 2020, 8:45pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/9 "2020-03-19T20:45:42Z")

</div>

Did you make it work?

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [April 27, 2022, 5:41pm UTC](https://forum.inductiveautomation.com/t/disabled-component-colors/3927/10 "2022-04-27T17:41:31Z")

</div>

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.
