I have a problem with my JButton ActionListener. I have a doTheCleaning () method defined in another class that, when called, makes a number of changes to my GUI.
public void doTheCleaning(){
Then in another class I created an instance of a class containing my doTheCleaning () method, and my ActionListener was written with my actionperformed () method for my jbutton, written as follows:
public void actionPerformed(ActionEvent e){
I know how to do the rest, like addActionListener () and stuff, so no need to ask about it. My concern is that all the changes in my GUI that are made when the toTheCleaning () method is called are applied only after the button is clicked. When this happens, the sequence of changes that occurred in my shortcuts and text box was not displayed. The code works fine if I called it directly in the tester class, but calling it inside the actionperformed method shows only the final state of my GUI. I need to show which item changed first, then next, etc.
How can I achieve this when I need these changes only when I click JButton?
** I am not very good at GUI in java. I hope you guys understood my point without my code. but I could if necessary. Thank you
source share