01: import java.awt.*;
02: import javax.swing.*;
03: 
04: /**
05:    This program demonstrates how an icon is adapted to
06:    a component. The component is added to a frame.
07: */
08: public class IconAdapterTester
09: {
10:    public static void main(String[] args)
11:    {
12:       Icon icon = new CarIcon(300);
13:       JComponent component = new IconAdapter(icon);
14: 
15:       JFrame frame = new JFrame();
16:       frame.add(component, BorderLayout.CENTER);
17:       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
18:       frame.pack();
19:       frame.setVisible(true);
20:    }
21: }