/*
Chapter 5:
5.1
Programmer: Brad Shedd
Date:
June 7, 2006
Filename:
ChoiceComponent.java
Purpose: This program
displays a drop-down list created using a Choice Component.
*/
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;
public
class
ChoiceComponent
extends Frame
{
Panel optionPanel =
new
Panel();
Choice
zoomChoice =
new
Choice();
public
ChoiceComponent()
{
this.setLayout(new
BorderLayout());
optionPanel.setLayout(new
FlowLayout());
optionPanel.add(zoomChoice);
zoomChoice.add("500%");
zoomChoice.add("200%");
zoomChoice.add("150%");
zoomChoice.add("100%");
zoomChoice.add("75%");
zoomChoice.add("50%");
zoomChoice.add("25%");
zoomChoice.add("10%");
zoomChoice.add("Page
Width");
zoomChoice.add("Text
Width");
zoomChoice.add("Whole
Pages");
zoomChoice.add("Two
Pages");
add(optionPanel, BorderLayout.NORTH);
}
public
static
void
main(String[] args)
{
ChoiceComponent f =
new
ChoiceComponent();
f.setBounds(425,200,200,300);
f.setTitle("Choice
Component");
f.setVisible(true);
}
//end of
main
}