Hi folks--
I took on a pet project the other day and am using WindowBuilder in eclipse to create a panel in Java. I am having some issues trying to enable a text field based on a selection in a checkbox. I somehow need the text field to refresh after the checkbox is checked, in order for the change to become apparent.
I know I need an ActionListener, and from there I can set textfield.setEnabled(true). However, since the disable action is run as the JFrame is rendered, I can't figure out how to change it dynamically. I've tried methods like repaint() and had no luck. Anyone have any ideas?
Regards,
Matt
I took on a pet project the other day and am using WindowBuilder in eclipse to create a panel in Java. I am having some issues trying to enable a text field based on a selection in a checkbox. I somehow need the text field to refresh after the checkbox is checked, in order for the change to become apparent.
I know I need an ActionListener, and from there I can set textfield.setEnabled(true). However, since the disable action is run as the JFrame is rendered, I can't figure out how to change it dynamically. I've tried methods like repaint() and had no luck. Anyone have any ideas?
Regards,
Matt
Last edited: