When I start some processing, I want to disable the JButtons, JText, Lists, etc. in the GUI, only having one button to stop the processing.
What is a clean way to do this? I was setting component by component with setEnabled(false), but the code was too big.
Can I get all the components in an array and set all inside a for loop? How I do this? There is another way?
You can use the Disabled Glass Pane approach.
Or, use a JOptionPane with a message like “Processing….”. When the processing is finished you close the dialog. Read the API for an example of how to create the option pane so that you have access to the actual dialog used. You will need the reference to the dialog so you can close it.
Edit:
See: How to Make Dialogs for examples.