001package horstmann.ch10_adapter;
002import java.awt.BorderLayout;
003
004import javax.swing.Icon;
005import javax.swing.JComponent;
006import javax.swing.JFrame;
007
008/**
009   This program demonstrates how an icon is adapted to
010   a component. The component is added to a frame.
011 */
012public class IconAdapterTester
013{
014        public static void main(String[] args)
015        {
016                Icon icon = new CarIcon(300);
017                JComponent component = new IconAdapter(icon);
018
019                JFrame frame = new JFrame();
020                frame.add(component, BorderLayout.CENTER);
021                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
022                frame.pack();
023                frame.setVisible(true);
024        }
025}