javascript
Brief description  about Online courses   join in Online courses
View Akhmad Durdibayevich Qutlimuratov 's Profile

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?
Replies (2)
View akhmad durdibayevich qutlimuratov 's Profile
Thanks a lot mate :)
Jan 19, 2011
View priti m naik 's Profile
the same way itself
theere is

checkBox.addActionListener(actionListener);
checkBox.addChangeListener(changeListener);
checkBox.addItemListener(itemListener);

http://www.java2s.com/Code/Java/Event/CheckBoxItemListener.htm
Jan 19, 2011