import java.applet.Applet;
import java.awt.Checkbox;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public class Checklist
extends Applet implements ItemListener{
Checkbox java = null;
Checkbox oracle = null;
Checkbox DOTNET = null;
public void init(){
java = new Checkbox("Java");
oracle = new Checkbox("oracle");
DOTNET = new Checkbox("DOTNET");
add(java);
add(oracle);
add(DOTNET);
java.addItemListener(this);
oracle.addItemListener(this);
DOTNET.addItemListener(this);
}
public void paint(Graphics g){
g.drawString("Java: " + java.getState(),10,80);
g.drawString("oracle: " + oracle.getState(), 10, 100);
g.drawString("DOTNET: " + DOTNET.getState(), 10, 120);
}
public void itemStateChanged(ItemEvent ie) {
repaint();
}
}
import java.awt.Checkbox;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public class Checklist
extends Applet implements ItemListener{
Checkbox java = null;
Checkbox oracle = null;
Checkbox DOTNET = null;
public void init(){
java = new Checkbox("Java");
oracle = new Checkbox("oracle");
DOTNET = new Checkbox("DOTNET");
add(java);
add(oracle);
add(DOTNET);
java.addItemListener(this);
oracle.addItemListener(this);
DOTNET.addItemListener(this);
}
public void paint(Graphics g){
g.drawString("Java: " + java.getState(),10,80);
g.drawString("oracle: " + oracle.getState(), 10, 100);
g.drawString("DOTNET: " + DOTNET.getState(), 10, 120);
}
public void itemStateChanged(ItemEvent ie) {
repaint();
}
}
No comments:
Post a Comment