import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
// this is a program with a label and checkboxes. 
// it has no interaction with the user

public class CheckBoxTest extends JFrame {
    // the label displays the total price
    private JLabel display = new JLabel("The total price is : $0");
    // a list of JCheckBox, with the the electronic components on it 
    // and also the price
    private JCheckBox computer = new JCheckBox("Computer: $900");
    private JCheckBox dvd = new JCheckBox("DVD: $250");
    private JCheckBox printer = new JCheckBox("Printer: $70");
    private JCheckBox monitor = new JCheckBox("Monitor: $299");
    // the panel contains the checkboxes
    private JPanel pricePanel = new JPanel(new GridLayout(1,0));
    
    // constructor
    public CheckBoxTest() {
	getContentPane().add(display);
	// add the components to the pricePanel
	pricePanel.add(computer);
	pricePanel.add(dvd);
	pricePanel.add(printer);
	pricePanel.add(monitor);
	getContentPane().add(pricePanel, BorderLayout.SOUTH);
    }
    
    public static void main(String[] args) {
        CheckBoxTest f = new CheckBoxTest();
	f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	f.pack();
	f.setVisible(true);
    }
}
	
	
    
