You could add an ItemListener
to the JCheckBox
. Whenever you (un)select a JTextBox
, this event will be triggered. Then, you can check which JTextBox
was changed and it's new value, and then enable the JTextBox
on the other row (with JCheckBox.setEnabled(true/false)
).
See more info here: http://docs.oracle.com/javase/tutorial/uiswing/events/itemlistener.html