/* Label, RadioButton, CheckBox & Button */ import java.awt.*; class MyList { MyList() { Frame f= new Frame("Label, CheckBox and Button"); //--------------- RadioButton ------------------------- CheckboxGroup cbg = new CheckboxGroup(); Checkbox checkBox1 = new Checkbox("C++", cbg, false); checkBox1.setBounds(100,250, 50,50); Checkbox checkBox2 = new Checkbox("Java", cbg, true); checkBox2.setBounds(100,300, 50,50); f.add(checkBox1); f.add(checkBox2); //--------------- Label ------------------------- Label l; l = new Label("Label"); l.setBounds(100,50, 100,30); f.add(l); //--------------- CheckBox ------------------------- Checkbox checkbox1 = new Checkbox("Python"); checkbox1.setBounds(100,100, 100,50); Checkbox checkbox2 = new Checkbox("Java", true); checkbox2.setBounds(100,150, 100,50); f.add(checkbox1); f.add(checkbox2); //--------------- Button ------------------------- Button b=new Button("Button"); b.setBounds(100,200,100,50); f.add(b); f.setSize(400,400); f.setLayout(null); f.setVisible(true); } } class Main { public static void main(String args[]) { new MyList(); } }
Search Here
Java program to create Label, RadioButton, CheckBox & Button
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment