QuizShape.java - package quizshape import import import...

This preview shows page 1 - 3 out of 3 pages.

package quizshape; import java.awt.Color; import java.awt.FlowLayout; import java.awt.Graphics; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JRadioButton; /** * * @author El Tik */ public class QuizShape extends JFrame implements ActionListener{ JPanel p , p1 , p2 , p3; JLabel l1,l2; JRadioButton r1 ,r2; JCheckBox c1,c2; JButton b1; public QuizShape(){ this.setTitle("Shapes "); this.setSize(300, 300); this.setVisible(true); this.setLocation(700, 200); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); p = new JPanel(); p.setLayout(new GridLayout(4,1)); p1 = new JPanel(); p1.setLayout(new FlowLayout(FlowLayout.CENTER)); l1 = new JLabel("Colors : "); p1.add(l1); c1 = new JCheckBox("red"); c2 = new JCheckBox("Blue"); c1.addActionListener(this); c2.addActionListener(this); p1.add(c1); p1.add(c2); p.add(p1); this.add(p); p2 = new JPanel(); p2.setLayout(new FlowLayout(FlowLayout.CENTER));

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture