// Using a Checkbox.
// Will show up as the words "with cream" with a box to check
// if you want cream.

/* ... */

boolean wantsCream = false;

/**
 * do you want cream in your coffee? default, no
 */
Checkbox cream;

/* ... */

cream = new Checkbox( "with cream", wantsCream );

cream.addItemListener ( new ItemListener()
   {

   public void itemStateChanged( ItemEvent e )
      {
       wantsCream = cream.getState();
      /* ... */
      }
   });
/* ... */