# Cannot coerce value '2' into type: interface javax.swing.border.Border

**URL:** <https://forum.inductiveautomation.com/t/cannot-coerce-value-2-into-type-interface-javax-swing-border-border/100330>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [December 31, 2024, 6:40am UTC](https://forum.inductiveautomation.com/t/cannot-coerce-value-2-into-type-interface-javax-swing-border-border/100330 "2024-12-31T06:40:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 3, 2025, 5:46am UTC](https://forum.inductiveautomation.com/t/cannot-coerce-value-2-into-type-interface-javax-swing-border-border/100330/3 "2025-01-03T05:46:14Z")

</div>

You can't use a number for a border. You must use the [toBorder() expression function](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/type-casting/toBorder).

---

_[View the full topic](https://forum.inductiveautomation.com/t/cannot-coerce-value-2-into-type-interface-javax-swing-border-border/100330)._
