// Exercise 12.10 solution

// ColorSelect.java

// This program creates a simple GUI

import javax.swing.*;

import java.awt.*;



public class ColorSelect extends JApplet {

   private JButton ok, cancel;

   private JCheckBox b, f;

   private JComboBox colorList;

   private JPanel p, p1;



   public void init()

   {

      // applet

      getContentPane().setLayout( new BorderLayout() );



      // north

      colorList = new JComboBox();

      colorList.addItem( "RED" );

      getContentPane().add( colorList, BorderLayout.NORTH );



      // center

      p = new JPanel();

      b = new JCheckBox( "background" );

      f = new JCheckBox( "foreground" );

      p.add( b );

      p.add( f );

      getContentPane().add( p, BorderLayout.CENTER );



      // south

      ok = new JButton( "Ok" );

      cancel = new JButton( "Cancel" );

      p1 = new JPanel();

      p1.add( ok );

      p1.add( cancel );

      getContentPane().add( p1, BorderLayout.SOUTH );

   }

}
