sicotic87

Shape Selection Screen

Dec 11th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.28 KB | None | 0 0
  1. package deskcentermain;
  2.  
  3. import javax.swing.*;
  4. import java.awt.*;
  5. import java.awt.Event.*;
  6. import java.awt.event.ActionEvent;
  7. import java.awt.event.ActionListener;
  8. import java.io.*;
  9.  
  10. public class ShapeSelectionScreen extends JFrame {
  11.    
  12.     private JPanel panel;
  13.     private JLabel label;
  14.     private JButton button1;
  15.     private JButton button2;
  16.     private JButton button3;
  17.     private JButton button4;
  18.     private JButton button5;
  19.     private JButton button6;
  20.     private JButton button7;
  21.     private JButton button8;
  22.     private JButton button9;
  23.     private JButton button10;
  24.     private JButton button11;
  25.     private JButton button12;
  26.     private JButton button13;
  27.  
  28.    
  29.     private final int WIDTH = 200;
  30.     private final int LENGTH = 325;
  31.    
  32.     public ShapeSelectionScreen(){
  33.        
  34.         this.setTitle("Welcome to DeskCenter");
  35.        
  36.         this.setSize(WIDTH, LENGTH);
  37.        
  38.         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  39.         this.setLocationRelativeTo(null);
  40.        
  41.         panel = new JPanel();
  42.        
  43.         this.label = new JLabel("Please select an option below");
  44.        
  45.         this.button1 = new JButton("Circle");
  46.         this.button2 = new JButton("Parallelogram");
  47.         this.button3 = new JButton("Pyramid");
  48.         this.button4 = new JButton("Rectangle");
  49.         this.button5 = new JButton("Solid Rectangle");
  50.         this.button6 = new JButton("Sphere");
  51.         this.button7 = new JButton("Square");
  52.         this.button8 = new JButton("Triangle");
  53.         this.button9 = new JButton("Cube");
  54.         this.button10 = new JButton("Trapezoid");
  55.         this.button11 = new JButton("Prism");
  56.         this.button12 = new JButton("Cylinder");
  57.         this.button13 = new JButton("Cone");
  58.        
  59.      
  60.        
  61.         panel.add(this.label);
  62.         panel.add(this.button1);
  63.         panel.add(this.button2);
  64.         panel.add(this.button3);
  65.         panel.add(this.button4);
  66.         panel.add(this.button5);
  67.         panel.add(this.button6);
  68.         panel.add(this.button7);
  69.         panel.add(this.button8);
  70.         panel.add(this.button9);
  71.         panel.add(this.button10);
  72.         panel.add(this.button11);
  73.         panel.add(this.button12);
  74.         panel.add(this.button13);
  75.        
  76.         button1.addActionListener(new CircleButtonListener());
  77.         button2.addActionListener(new ParallelogramButtonListener());
  78.         button3.addActionListener(new PyramidButtonListener());
  79.         button4.addActionListener(new RectangleButtonListener());
  80.         button5.addActionListener(new SRectangleButtonListener());
  81.         button6.addActionListener(new SphereButtonListener());
  82.         button7.addActionListener(new SquareButtonListener());
  83.         button8.addActionListener(new TriangleButtonListener());
  84.         button9.addActionListener(new CubeButtonListener());
  85.         button10.addActionListener(new TrapezoidButtonListener());
  86.         button11.addActionListener(new PrismButtonListener());
  87.         button12.addActionListener(new CylinderButtonListener());
  88.         button13.addActionListener(new ConeButtonListener());
  89.        
  90.         this.add(this.panel);
  91.        
  92.         this.setVisible(true);
  93.        
  94.        
  95.        
  96.     }
  97.     //END OF MAIN CLASS
  98.     private class CircleButtonListener implements ActionListener{
  99.        
  100.         public void actionPerformed(ActionEvent e)
  101.         {
  102.            
  103.             //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  104.         }
  105.        
  106.     }
  107.     // END OF CIRCLE BUTTON CLASS
  108.     private class ParallelogramButtonListener implements ActionListener{
  109.        
  110.         public void actionPerformed(ActionEvent e)
  111.         {
  112.            
  113.             //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  114.            
  115.         }
  116.        
  117.         }
  118.     // END OF PARALLELOGRAM BUTTON CLASS
  119. private class PyramidButtonListener implements ActionListener{
  120.        
  121.         public void actionPerformed(ActionEvent e)
  122.         {
  123.            
  124.             //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  125.            
  126.         }
  127.        
  128.         }
  129.     // END OF PYRAMID BUTTON CLASS
  130. private class RectangleButtonListener implements ActionListener{
  131.    
  132.     public void actionPerformed(ActionEvent e)
  133.     {
  134.        
  135.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  136.        
  137.     }
  138.    
  139.     }
  140. // END OF RECTANGLE BUTTON CLASS
  141. private class SRectangleButtonListener implements ActionListener{
  142.    
  143.     public void actionPerformed(ActionEvent e)
  144.     {
  145.        
  146.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  147.        
  148.     }
  149.    
  150.     }
  151. // END OF SRECTANGLE BUTTON CLASS
  152. private class SphereButtonListener implements ActionListener{
  153.    
  154.     public void actionPerformed(ActionEvent e)
  155.     {
  156.        
  157.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  158.        
  159.     }
  160.    
  161.     }
  162. // END OF SPHERE BUTTON CLASS
  163. private class SquareButtonListener implements ActionListener{
  164.    
  165.     public void actionPerformed(ActionEvent e)
  166.     {
  167.        
  168.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  169.        
  170.     }
  171.    
  172.     }
  173. // END OF SQUARE BUTTON CLASS
  174. private class TriangleButtonListener implements ActionListener{
  175.    
  176.     public void actionPerformed(ActionEvent e)
  177.     {
  178.        
  179.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  180.        
  181.     }
  182.    
  183.     }
  184. // END OF TRIANGLE BUTTON CLASS
  185. private class CubeButtonListener implements ActionListener{
  186.    
  187.     public void actionPerformed(ActionEvent e)
  188.     {
  189.        
  190.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  191.        
  192.     }
  193.    
  194.     }
  195. // END OF CUBE BUTTON CLASS
  196. private class TrapezoidButtonListener implements ActionListener{
  197.    
  198.     public void actionPerformed(ActionEvent e)
  199.     {
  200.        
  201.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  202.        
  203.     }
  204.    
  205.     }
  206. // END OF TRAPEZOID BUTTON CLASS
  207. private class PrismButtonListener implements ActionListener{
  208.    
  209.     public void actionPerformed(ActionEvent e)
  210.     {
  211.        
  212.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  213.        
  214.     }
  215.    
  216.     }
  217. // END OF PRISM BUTTON CLASS
  218. private class CylinderButtonListener implements ActionListener{
  219.    
  220.     public void actionPerformed(ActionEvent e)
  221.     {
  222.        
  223.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  224.        
  225.     }
  226.    
  227.     }
  228. // END OF CYLINDER BUTTON CLASS
  229. private class ConeButtonListener implements ActionListener{
  230.    
  231.     public void actionPerformed(ActionEvent e)
  232.     {
  233.        
  234.         //INSERT GUI THAT WOULD CONTAIN BUTTONS FOR EACH CALCULATION FOR THE SHAPE
  235.        
  236.     }
  237.    
  238.     }
  239. // END OF CONE BUTTON CLASS
  240.  
  241.    
  242.     }
Advertisement
Add Comment
Please, Sign In to add comment