import javax.swing.*;
import java.awt.event.*;
class Main extends JFrame implements ActionListener{
JLabel K;
JCheckBox cb1, cb2, cb3, cb4, cb5;
JButton B;
Main(){
JFrame myframe = new JFrame();
myframe.setVisible(true);
myframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myframe.setSize(500,600);
myframe.setLocation(400,400);
myframe.setTitle("KPOP MERCHS FOR YOU");
K= new JLabel("WELCOME TO KPOP MERCHANDISE SHOP! PLEASE CHOOSE YOUR ITEM(S)");
K.setBounds(50,50,300,20);
cb1=new JCheckBox("BTS LIGHTSTICK - PHP1200.00");
cb1.setBounds(100,100,300,20);
cb2=new JCheckBox("BLACKPINK PHOTOCARDS SET - PHP1000.00");
cb2.setBounds(100,150,300,20);
cb3=new JCheckBox("TWICE ALBUM (SEALED) - PHP3000.00");
cb3.setBounds(100,200,300,20);
cb4=new JCheckBox("TWICE ALBUM (UNSEALED) - 1500.00");
cb4.setBounds(100,250,300,20);
cb5=new JCheckBox("STRAYKIDS T-SHIRT - PHP2000.00");
cb5.setBounds(100,300,300,20);
B=new JButton("CHECK OUT");
B.setBounds(100,350,120,30);
B.addActionListener(this);
add(K);add(cb1);add(cb2);add(cb3);add(cb4);add(cb5);add(B);
setSize(600,800);
setLayout(null);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent e){
float amount=0;
String msg="";
if(cb1.isSelected()){
amount+=1200.00;
msg="BTS LIGHTSTICK: PHP1200.00\n";
}
if(cb2.isSelected()){
amount+=1000.00;
msg="BLACKPINK PHOTOCARDS SET: PHP1000.00\n";
}
if(cb3.isSelected()){
amount+=3000.00;
msg="TWICE ALBUM (SEALED): PHP3000.00\n";
}
if(cb4.isSelected()){
amount+=1500.00;
msg="TWICE ALBUM (UNSEALED): PHP1500.00\n";
}
if(cb3.isSelected()){
amount+=2000.00;
msg="STRAYKIDS T-SHIRT: PHP2000.00\n";
}
msg+="---------------\n";
JOptionPane.showMessageDialog(this,msg+"Total: "+amount);
}
public static void
main(String[] args) {
new KpopMerchShop();
}
}