What is the difference between Swing and AWT?

AWT is a Java interface to native system GUI code present in your OS. It will not work the same on every system, although it tries. Swing is a more-or-less pure-Java GUI. It uses AWT to create an operating system window and then paints pictures of buttons, labels, text, checkboxes, etc., into that window and … Read more

What does SwingUtilities.invokeLater do? [duplicate]

As other answers have said, it executes your Runnable on the AWT event-dispatching thread. But why would you want to do that? Because the Swing data structures aren’t thread-safe, so to provide programmers with an easily-achievable way of preventing concurrent access to them, the Swing designers laid down the rule that all code that accesses … Read more

Java and GUI – Where do ActionListeners belong according to MVC pattern?

That’s a very difficult question to answer with Swing, as Swing is not a pure MVC implementation, the view and controller are mixed. Technically, a model and controller should be able to interact and the controller and view should be able to interact, but the view and model should never interact, which clearly isn’t how … Read more