previous | start | next

## Graphic Programming with Inheritance

- Chapter 4: Create drawings by by implementing `Icon` interface type
- Now: Form subclass of `JComponent`
  `public class MyComponent extends JComponent
  {
  public void paintComponent(Graphics g)
  {
  drawing instructions go here
  }
  ...
  }`
- Advantage: Inherit behavior from `JComponent`
- Example: Can attach mouse listener to `JComponent`

previous | start | next