Friday, 16 August 2013

InvokeLater() - will just once be enough?

InvokeLater() - will just once be enough?

pI use the recommended code to start my interactive program, which uses
Swing. :/p precode public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater( new Runnable() { public void run()
{ createAndShowGUI(); } } ) }; /code/pre pPIt creates a JFrame, call it
Foo, and ends when the user closes that window (by using the OS' Close-
Window X icon or another OS way to close the app) PI want to display
another window, Bar, get user input, close that window with my own Swing
calls, and then display the Foo window. PI could reuse the same JFrame for
Foo and Bar, and just clear it out in-between. But I prefer to make each
of them more independent in their design. So, an ActionListener in Foo
would need to close Foo's frame, and call the code that displays Bar.br
PDo I need to use InvokeLater() to call the code that displays Bar? To get
more design independence,br I am unclear on the operation of the EDT./p

No comments:

Post a Comment