FileDocCategorySizeDatePackage
Shout.javaAPI DocExample1817Thu Nov 29 11:01:48 GMT 2001None

Shout

public class Shout extends Applet implements ItemListener

Fields Summary
private Label
title
private Checkbox
someTimes
private Checkbox
always
private Checkbox
never
private Panel
pan1
private Panel
pan2
private Panel
pan3
private Panel
pan4
private Panel
pan5
private TextField
answerBox
Constructors Summary
Methods Summary
public voidinit()

 
    	setLayout(new BorderLayout(10,10));

    	pan1 = new Panel();   	
    	pan1.setBackground(Color.cyan);
    	this.add("North",pan1);
		title = new Label("Do you understand these lectures?");	
		pan1.add(title);
	
		never = new Checkbox("Never");	  			
		pan2=new Panel();
		pan2.setBackground(Color.red);
		this.add("West",pan2);
		pan2.add(never);
		never.addItemListener(this);

		someTimes = new Checkbox("Sometimes");	
		pan3=new Panel();
	  	pan3.setBackground(Color.yellow);
	  	this.add("Center",pan3);
	  	pan3.add(someTimes); 
	  	someTimes.addItemListener(this);
	  	
	  	always = new Checkbox("Always");
	  	pan4=new Panel();
	  	pan4.setBackground(Color.gray);
	  	this.add("East",pan4);
	  	pan4.add(always);
   		always.addItemListener(this);	 
		
		
  	 	answerBox = new TextField(16);
  	 	pan5=new Panel();
	  	pan5.setBackground(Color.green);
	  	this.add("South",pan5);	  	 
  	 	pan5.add(answerBox);
  	 
public voiditemStateChanged(java.awt.event.ItemEvent ae)

     	if (ae.getSource() == never)
     	{
      		answerBox.setText("Show your face!");
      	}              
      		if (ae.getSource() == someTimes)
     	{
      		answerBox.setText("Raise your hand...");
      	}               		
      		if (ae.getSource() == always)
     	{
      		answerBox.setText("Lift a flag.");
      	}        
      	repaint();       		 		
    
public voidpaint(java.awt.Graphics g)