# Any way to replicate "Other Border" on components like the Dropdown List?

**URL:** <https://forum.inductiveautomation.com/t/any-way-to-replicate-other-border-on-components-like-the-dropdown-list/35683>\
**Category:** Ignition\
**Created:** [June 15, 2020, 11:31pm UTC](https://forum.inductiveautomation.com/t/any-way-to-replicate-other-border-on-components-like-the-dropdown-list/35683 "2020-06-15T23:31:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [June 15, 2020, 11:31pm UTC](https://forum.inductiveautomation.com/t/any-way-to-replicate-other-border-on-components-like-the-dropdown-list/35683/1 "2020-06-15T23:31:32Z")

</div>

I was hoping for a way to manually set the border property on certain components, like the Drowdown List, through expression or the Border chooser on the border property.

Some components have a preset property that says “Other Border”. I would like to do a conditional expression to set a red line around the border with the same look it has, else keep it the way it is by default. I tried selecting many combinations of options, but couldn’t replicate the default.

Otherwise, some workarounds are to put a rectangle of the same size of the component, set the fill opacity to zero or possibly get into the java swing code, but unable to find good resources or examples.

---

<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:** [June 16, 2020, 12:31am UTC](https://forum.inductiveautomation.com/t/any-way-to-replicate-other-border-on-components-like-the-dropdown-list/35683/2 "2020-06-16T00:31:49Z")

</div>

Not a complete working example, but toggling between the two states could be done with something like this:

```auto
from javax.swing import BorderFactory
from javax.swing.border import CompoundBorder

target = event.source.parent.getComponent("Dropdown")
# Add an outer red line border
target.border = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(system.gui.color(255, 0, 0), 3), target.border)

# Reset to the original border
if isinstance(target.border, CompoundBorder):
	target.border = target.border.insideBorder

```

---

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [June 16, 2020, 2:30pm UTC](https://forum.inductiveautomation.com/t/any-way-to-replicate-other-border-on-components-like-the-dropdown-list/35683/3 "2020-06-16T14:30:58Z")

</div>

> [@paul-griffith](#):
>
> from javax.swing import BorderFactory from javax.swing.border import CompoundBorder target = event.source.parent.getComponent("Dropdown") # Add an outer red line border target.border = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(system.gui.color(255, 0, 0), 3), target.border) # Reset to the original border if isinstance(target.border, CompoundBorder): target.border = target.border.insideBorder

Thank you. This does what I need through script. For anyone else, as written above on a button or some action event, it will cancel each other out so it does nothing, but the first "target.border =" could be in an if statement or separate action event/component.

Further more, to make this work in bindings, one could create a hidden component of each type (default, and one with border changed), then bind your working component's borders to these.
