Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package deskcentermain;
- import javax.swing.*;
- import java.awt.*;
- import java.awt.Event.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.io.*;
- public class ShapeSelectionScreen extends JFrame {
- private JPanel panel;
- private JLabel label;
- private JButton button1;
- private JButton button2;
- private JButton button3;
- private JButton button4;
- private JButton button5;
- private JButton button6;
- private JButton button7;
- private JButton button8;
- private JButton button9;
- private JButton button10;
- private JButton button11;
- private JButton button12;
- private JButton button13;
- private final int WIDTH = 200;
- private final int LENGTH = 325;
- public ShapeSelectionScreen(){
- this.setTitle("Welcome to DeskCenter");
- this.setSize(WIDTH, LENGTH);
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.setLocationRelativeTo(null);
- panel = new JPanel();
- this.label = new JLabel("Please select an option below");
- this.button1 = new JButton("Circle");
- this.button2 = new JButton("Parallelogram");
- this.button3 = new JButton("Pyramid");
- this.button4 = new JButton("Rectangle");
- this.button5 = new JButton("Solid Rectangle");
- this.button6 = new JButton("Sphere");
- this.button7 = new JButton("Square");
- this.button8 = new JButton("Triangle");
- this.button9 = new JButton("Cube");
- this.button10 = new JButton("Trapezoid");
- this.button11 = new JButton("Prism");
- this.button12 = new JButton("Cylinder");
- this.button13 = new JButton("Cone");
- panel.add(this.label);
- panel.add(this.button1);
- panel.add(this.button2);
- panel.add(this.button3);
- panel.add(this.button4);
- panel.add(this.button5);
- panel.add(this.button6);
- panel.add(this.button7);
- panel.add(this.button8);
- panel.add(this.button9);
- panel.add(this.button10);
- panel.add(this.button11);
- panel.add(this.button12);
- panel.add(this.button13);
- button1.addActionListener(new CircleButtonListener());
- button2.addActionListener(new ParallelogramButtonListener());
- button3.addActionListener(new PyramidButtonListener());
- button4.addActionListener(new RectangleButtonListener());
- button5.addActionListener(new SRectangleButtonListener());
- button6.addActionListener(new SphereButtonListener());
- button7.addActionListener(new SquareButtonListener());
- button8.addActionListener(new TriangleButtonListener());
- button9.addActionListener(new CubeButtonListener());
- button10.addActionListener(new TrapezoidButtonListener());
- button11.addActionListener(new PrismButtonListener());
- button12.addActionListener(new CylinderButtonListener());
- button13.addActionListener(new ConeButtonListener());
- this.add(this.panel);
- this.setVisible(true);
- }
- //END OF MAIN CLASS
- private class CircleButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF CIRCLE BUTTON CLASS
- private class ParallelogramButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF PARALLELOGRAM BUTTON CLASS
- private class PyramidButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF PYRAMID BUTTON CLASS
- private class RectangleButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF RECTANGLE BUTTON CLASS
- private class SRectangleButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF SRECTANGLE BUTTON CLASS
- private class SphereButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF SPHERE BUTTON CLASS
- private class SquareButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF SQUARE BUTTON CLASS
- private class TriangleButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF TRIANGLE BUTTON CLASS
- private class CubeButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF CUBE BUTTON CLASS
- private class TrapezoidButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF TRAPEZOID BUTTON CLASS
- private class PrismButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF PRISM BUTTON CLASS
- private class CylinderButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF CYLINDER BUTTON CLASS
- private class ConeButtonListener implements ActionListener{
- public void actionPerformed(ActionEvent e)
- {
- //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
- }
- }
- // END OF CONE BUTTON CLASS
- }
Advertisement
Add Comment
Please, Sign In to add comment