# Error setting property / binding alignment on buttons

**URL:** <https://forum.inductiveautomation.com/t/error-setting-property-binding-alignment-on-buttons/25121>\
**Category:** Ignition\
**Created:** [May 18, 2019, 1:52am UTC](https://forum.inductiveautomation.com/t/error-setting-property-binding-alignment-on-buttons/25121 "2019-05-18T01:52:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chasondeshotel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chasondeshotel/32/20032_2.png) [@chasondeshotel](https://forum.inductiveautomation.com/u/chasondeshotel)\
**Post date:** [May 18, 2019, 1:52am UTC](https://forum.inductiveautomation.com/t/error-setting-property-binding-alignment-on-buttons/25121/1 "2019-05-18T01:52:35Z")

</div>

I’m trying to bind Horizontal Alignment on a button to a template parameter, it’s an int… I’ve tried 0-5 and get

```auto
Error setting property to '1' for binding on
button.button.Button.horizontalAlignment
at com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter.updateTarget(AbstractPropertyAdapter.java:327)

Caused by: java.lang.IllegalArgumentException: horizontalAlignment
	at javax.swing.AbstractButton.checkHorizontalKey(Unknown Source)
	at javax.swing.AbstractButton.setHorizontalAlignment(Unknown Source)

```

What’s the trick?

---

<div class="post-metadata">

**Author:** ![chasondeshotel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chasondeshotel/32/20032_2.png) [@chasondeshotel](https://forum.inductiveautomation.com/u/chasondeshotel)\
**Post date:** [May 18, 2019, 2:07am UTC](https://forum.inductiveautomation.com/t/error-setting-property-binding-alignment-on-buttons/25121/2 "2019-05-18T02:07:15Z")

</div>

I guess I didn’t actually try 0-5… or had something goofed up when I did it. Even so, it’s kind of tricky.

To make this work, you have to use values of:

```auto
0 = Center
2 = Left
4 = Right
11 = Trailing

```

found here: [https://docs.oracle.com/javase/8/docs/api/constant-values.html](https://docs.oracle.com/javase/8/docs/api/constant-values.html) under ‘SwingConstants’
