CREATING CHECK BOX
Hi teacher,
package awt;
import java.awt.*;
import java.awt.event.*;
public class CheckBoxDemo {
public static void main(String[] args) {
Frame frame = new Frame("Checkbox");
Checkbox checkbox = new Checkbox("Welcome");
Checkbox checkbox1 = new Checkbox("Siliconindia");
frame.add(checkbox);
frame.add(checkbox1);
frame.setLayout(new FlowLayout());
frame.setSize(300, 200);
frame.setVisible(true);
frame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
}
In the above example, we learn to create checkboxes.
Can you show me please how we can create checkbox event, like button click event?