FileDocCategorySizeDatePackage
GraphicsTest.javaAPI DocSun JDK 1.4.2 Example11999Thu May 12 00:35:29 BST 2005None

GraphicsPanel

public class GraphicsPanel extends Panel

Fields Summary
ActionListener
al
ItemListener
il
public GraphicsCards
cards
Constructors Summary
GraphicsPanel(EventListener listener)

         al = (ActionListener)listener;
         il = (ItemListener)listener;

        setLayout(new BorderLayout());

        add("Center", cards = new GraphicsCards());

        Panel p = new Panel();
        //p.setLayout(new BorderLayout());

        Button b = new Button("next");
        b.addActionListener(al);
        p.add(b);

        b = new Button("previous");
        b.addActionListener(al);
        p.add(b);

        p.add(new Label("go to:", Label.RIGHT));

        Choice c = new Choice();
        c.addItemListener(il);
        p.add(c);

        c.addItem("Arc");
        c.addItem("Oval");
        c.addItem("Polygon");
        c.addItem("Rect");
        c.addItem("RoundRect");

        add("North", p);

        setSize(400, 400);
    
Methods Summary
public java.awt.DimensiongetPreferredSize()

        return new Dimension(200, 100);