# Set label border using event script

**URL:** <https://forum.inductiveautomation.com/t/set-label-border-using-event-script/67000>\
**Category:** Ignition\
**Tags:** ignition80, vision, scripting\
**Created:** [November 28, 2022, 9:34pm UTC](https://forum.inductiveautomation.com/t/set-label-border-using-event-script/67000 "2022-11-28T21:34:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![israel.jordan](https://avatars.discourse-cdn.com/v4/letter/i/ce73a5/32.png) [@israel.jordan](https://forum.inductiveautomation.com/u/israel.jordan)\
**Post date:** [November 28, 2022, 9:34pm UTC](https://forum.inductiveautomation.com/t/set-label-border-using-event-script/67000/1 "2022-11-28T21:34:43Z")

</div>

Hello,

I need to modify the border color of a Label while in the event script of another component. I am trying to follow the example in [Creating TitledPanel Border Object](https://forum.inductiveautomation.com/t/creating-titledpanel-border-object/15146). I have been able to get it to work but I am trying to get it to look more like the results of this call to the toBorder method in the expression binding on a labels Border property `toBorder("line;255,0,255,255;5")`. I'm not sure if [FieldBorder](http://files.inductiveautomation.com/sdk/javadoc/ignition784rc1/com/inductiveautomation/ignition/common/gui/border/FieldBorder.html) may be a better choice in this case. Can someone either point me in the right direction or show me a a working example of what I am trying to do?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 29, 2022, 12:35am UTC](https://forum.inductiveautomation.com/t/set-label-border-using-event-script/67000/2 "2022-11-29T00:35:39Z")

</div>

Probably something like this:

```auto
from javax.swing import BorderFactory
border = BorderFactory.createLineBorder(system.gui.color(255,0,255), 5)

```

[BorderFactory](https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/javax/swing/BorderFactory.html) has lots of static factory methods for standard Swing border types.
