What would be the best way to go about this issue I am having. On my dialog I have 4 change buttons.
Project: [ text ] [ change ]
3d: [ text ] [ change ]
2d: [ text ] [ change ]
Email: [ text ] [ change ]
When the dialog is created the only button enabled is change project. The bottom 3 fields are based off what project is selected, so that can not change the values until a project is selected.
The value for Project when the dialog is created is "NO SELECTED PROJECT" - I will then click the change project button and select a project. Right now all the bottom fields are populated and I want the change buttons for them to now be enabled.
so I wrote a if statement around the enable piece of code for the buttons
final JButton threeDButton = new JButton("Change");
threeDButton.setPreferredSize(new Dimension(100, 20));
if (checkProject == 1) {
threeDButton.setEnabled(true);
}
else {
threeDButton.setEnabled(false);
}
but the dialog is never created again or redrawn to where this way will work. Not sure it is good practice to refresh your main dialog often.
What do you think is the best way to do this check?