Containers: intro
Import packages
When writing
Java Graphical Applications
, you need to import these
packages
java.awt.*
: the
abstract window toolkit
- the first generation Java API
javax.swing.*
: the
"swing" extension toolkit
- provides additional functionality on top of AWT
Classes
that start with
J...
are
swing classes
Containers: used to
organize
GUI components
Containers:
JFrame
= a
heavy weight
container used as the
top-level window
JPanel
= a
light weight
container used to
organize
GUI components
How to
use these
containers
:
Various
GUI components
are
stuck (added)
on to one or more
JPanels
Then the
JPanels
are
stuck (added)
onto the
JFrame