Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package deskcenter;
- import javax.swing.*;
- import java.awt.*;
- public class WelcomeScreen extends JFrame{
- private JPanel panel;
- private JPanel panel2;
- private JPanel panel3;
- private JPanel panel4;
- private JPanel panel5;
- private JLabel label;
- private JButton button;
- private JButton button2;
- private JButton button3;
- private JButton button4;
- private final int WIDTH = 300;
- private final int LENGTH = 400;
- public WelcomeScreen() {
- this.setLayout(new FlowLayout());
- this.setTitle("Welcome");
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setSize(WIDTH, LENGTH);
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.setLocationRelativeTo(null);
- panel = new JPanel();
- this.label = new JLabel("Please choose an option below.");
- //this.button = new JButton("Trapezoid");
- //this.button2 = new JButton("Sphere");
- //this.button3 = new JButton("Parallelogram");
- //this.button4 = new JButton("Rectangle");
- panel.add(this.label);
- //panel.add(this.button);
- //panel.add(this.button2);
- //panel.add(this.button3);
- //panel.add(this.button4);
- this.add(panel);
- panel2 = new JPanel();
- this.button = new JButton("Trapezoid");
- panel2.add(this.button);
- this.add(panel2);
- panel3 = new JPanel();
- this.button2 = new JButton("Square");
- panel3.add(this.button2);
- this.add(panel3);
- panel4 = new JPanel();
- this.button3 = new JButton("Parallelogram");
- panel4.add(this.button3);
- this.add(panel4);
- this.setVisible(true);
- panel5 = new JPanel();
- this.button4 = new JButton("Rectangle");
- panel5.add(this.button4);
- this.add(panel5);
- }
- //ADD AN ACTION LISTENER FOR EACH BUTTON THAT WOULD BRING UP A NEW GUI ASKING THEM TO SELECT A MATHEMATICAL OPERATION TO PERFORM
- }
Advertisement
Add Comment
Please, Sign In to add comment