The actual exception contains the relevant information:
java.lang.IllegalStateException: javax.swing.JTextField[...lotsa garbage here...] is not attached to a vertical group
You are calling
layout.setHorizontalGroup(...)
and
layout.setVerticalGroup(...)
But in the latter, the JTextFields (xTField
and yTField
) are not appearing. Although this can be "fixed" by inserting these lines...
...
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(xLabel)
.addComponent(yLabel)
.addComponent(xTField) // <---
.addComponent(yTField) // <---
)
in the vertical group, I'd strongly recommend you to have a look at http://docs.oracle.com/javase/tutorial/uiswing/layout/index.html . Maybe I'm just not a great fan of "Visual GUI editors", but I think you should only use them when you can be sure that nobody ever has to look at the code again. (This rarely happens - draw your conclusions...)