GUI Concepts

Making Windows

Everytime you want a window to appear on screen, use a JFrame.

Drawing Primitives

If you want to make a custom GUI component (with shapes) then extend JPanel.

Getting Input

In order to get input from the mouse your GUI components must implement Listeners. Each listener reacts to user input in some way.

Widgets

Swing provides a bunch of interactive widgets you can use for building GUIs: JButtons, JTextFields, JLabels, JSliders, ...

Layout Managers

Layout managers are used to lay out different GUI components in a JPanel. You can nest layout managers inside each other

Relevant managers:

Other Tips and Tricks