import [Link].
*;
import [Link].*;
public class CheckBoxExample extends JFrame implements ActionListener
JLabel l;
JCheckBox cb1,cb2.cb3;
JButton b; CheckBoxExample f;
CheckBox Example()
I=new JLabel("Food Ordering System");
[Link] (50,50, 300,20); cb1=new JCheckBox("Pizza @ 100");
[Link](100,100,150,20); cb2=new JCheckBox("Burger @ 30");
[Link] (100,150,150,20); b=new JButton("Order"); [Link](100,250,80,30);
[Link](this);
cb3=new JCheckBox("Tea @ 10"); [Link](100,200,150,20);
add(1); add(cb1); add(cb2); add(cb3); add(b);
public void actionPerformed(ActionEvent e)
float amount=0; String msg="";
if([Link]())
amount+=100; // amount amount +100;
msg+="Pizza: 100\n";
if([Link]())
amount+=30;
msg+="Burger: 30\n";
}
if([Link]())
amount+=10;
msg+="Tea: 10\n";
msg+="
\n":
[Link]([Link]+" Total: "+amount); }
public static void main (String[] args)
Check Box Example f = new CheckBoxExample();
[Link](400,400);
[Link](null);
[Link](true);