AWT Components
We first describe the basic AWT components and the event handling model.
We next describe Swing components.
- The event handling model is the same.
- Each AWT component, such as Button, has a corresponding Swing component, called JButton.
- The Swing component typically may have additional functionality. For example, a Button’s appearance may have a text label and colors. In addition, a JButton may have an Icon on it.
- Swing components have a more complex implementation - they are essentially wrapper classes for a set of classes giving a “model - view - controller” design pattern:
- model gives contents - such as state or text
- view gives visual appearance
- controller gives behavior - such as reaction to events