It would be nice to have the double beveled edge of a component (like a numeric label) be a different color than the background. Since I don’t think this is a feature in Ignition, can someone explain how I can modify the color with javax.swing.border?
I am not particularly good at Java/Jython, but I figured it out. Here is how I am making it work:
[code]if event.propertyName == “Alarm_Level”:
from java.awt import Color
from javax.swing import BorderFactory
from javax.swing.border import *
if event.source.Alarm_Level == 0: c1 = Color.cyan elif event.source.Alarm_Level == 1: c1 = Color.yellow elif event.source.Alarm_Level == 2: c1 = Color.red elif event.source.Alarm_Level == 3: c1 = Color.blue c2 = c1.darker() border_one = BorderFactory.createBevelBorder(BevelBorder.RAISED, c1, c2) border_two = BorderFactory.createBevelBorder(BevelBorder.LOWERED, c1, c2) event.source.border = BorderFactory.createCompoundBorder(border_one, border_two)[/code]