This is my first time using Swing to create a simple graphical interface. It consists of a JFrame , on which I placed one JButton , which when clicked calls another code that takes approx. 3 seconds to return.
Just before calling this code, in actionPerformed() , I want to update the text on the button to tell the user that processing is happening. My problem is that the text on the button is not updated until the 3 second call returns. I want the updated text to be present during the conversation, after which I will change it later.
The repaint() call in JButton does nothing and calls it on the JFrame as a result of " Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException " when I click the button.
java swing swingworker repaint
William
source share