Hello.
I have decided to look again at Java after a *really* long break. While
browsing through the Swing tutorials [1], I noticed that the basic
skeleton of the demo applications had something new. There is now a
concern with thread-safety which is illustrated by the use of the
SwingUtilities. invokeLater() method for the GUI manipulation code.
In the demos, the private static method which is responsible for setting
up the GUI (createAndShowG UI) uses local instances in order to create
the main window and other Swing components as opposed to having the user
class actually extend JFrame and contain references to its child
components (JLabel, JButton, etc.). Is this how it should be done now?
What about having easy access to the frame's components? In case
extending from JFrame is still a current practice, could anyone describe
the idiom for it, if any? In other words, what would a basic Swing
application with a user class extending JFrame and the thread-safety
concern in place look like?
[1] http://java.sun.com/docs/books/tutorial/uiswing/learn/
Thank you,
--
Ney André de Mello Zunino