My application is using JOptionPanes at some points for input of information.
At the same time that JOptionPane is shown, changes can happen on the GUI that are made from other clients over the network. These can be text on JTextArea, or nodes changing on JTree.
Does that mean that I need to create the JOptionPane on a new thread so that I will not have problems on the changes made during JOptionPane is active?
I looked on a few places on internet but I did not get a clear answer.
p.s JOptionPane is created when a user clicks on a button.
Swing is single threaded, so the option of ‘using another thread’ is simply not an option. However, that does not mean your components can not be updated while the option pane is shown. See below for an example. I added a System.out call to illustrate that the JOptionPane call is blocking, but due to the Swing timer I can append text to my JTextArea (on the EDT).