Advertisement
fawadmir

AT-Test

Apr 19th, 2012
2,143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     import java.awt.GridBagLayout;
  2.     import javax.swing.JPanel;
  3.     import java.awt.Dimension;
  4.     import javax.swing.JTextField;
  5.     import java.awt.Rectangle;
  6.      
  7.     import javax.swing.JFrame;
  8.     import javax.swing.JLabel;
  9.     import javax.swing.JComboBox;
  10.     import javax.swing.JTextArea;
  11.     import javax.swing.JButton;
  12.      
  13.     public class NewSpecialRulePanel extends JPanel {
  14.      
  15.             private static final long serialVersionUID = 1L;
  16.             private JTextField ruleNameField = null;
  17.             private JLabel RuleNameLabel = null;
  18.             private JLabel ThenLabel = null;
  19.             private JLabel ifLabel1 = null;
  20.             private JComboBox valueComboBox = null;
  21.             private JLabel ifLabel2 = null;
  22.             private JComboBox suitComboBox = null;
  23.             private JLabel ifLabel3 = null;
  24.             private JButton doneButton = null;
  25.             private JComboBox specialEffectComboBox = null;
  26.             /**
  27.              * This is the default constructor
  28.              */
  29.             @SuppressWarnings("deprecation")
  30.             public static void main(String[] args)
  31.             {
  32.                     NewSpecialRulePanel test = new NewSpecialRulePanel();
  33.                     JFrame frame = new JFrame();
  34.                     frame.add(test);
  35.                     frame.show();
  36.                     frame.setSize(274,215);
  37.             }
  38.            
  39.             public NewSpecialRulePanel() {
  40.                     super();
  41.                     initialize();
  42.             }
  43.      
  44.             /**
  45.              * This method initializes this
  46.              *
  47.              * @return void
  48.              */
  49.             private void initialize() {
  50.                     ifLabel3 = new JLabel();
  51.                     ifLabel3.setBounds(new Rectangle(201, 62, 60, 16));
  52.                     ifLabel3.setText("is played");
  53.                     ifLabel2 = new JLabel();
  54.                     ifLabel2.setBounds(new Rectangle(85, 61, 16, 19));
  55.                     ifLabel2.setText("of");
  56.                     ifLabel1 = new JLabel();
  57.                     ifLabel1.setBounds(new Rectangle(3, 61, 16, 20));
  58.                     ifLabel1.setText("If");
  59.                     ThenLabel = new JLabel();
  60.                     ThenLabel.setBounds(new Rectangle(7, 97, 127, 15));
  61.                     ThenLabel.setText("Then this happens -->");
  62.                     RuleNameLabel = new JLabel();
  63.                     RuleNameLabel.setBounds(new Rectangle(13, 16, 70, 16));
  64.                     RuleNameLabel.setText("Rule Name:");
  65.                     this.setSize(274, 191);
  66.                     this.setLayout(null);
  67.                     this.add(getRuleNameField(), null);
  68.                     this.add(RuleNameLabel, null);
  69.                     this.add(ThenLabel, null);
  70.                     this.add(ifLabel1, null);
  71.                     this.add(getValueComboBox(), null);
  72.                     this.add(ifLabel2, null);
  73.                     this.add(getSuitComboBox(), null);
  74.                     this.add(ifLabel3, null);
  75.                     this.add(getDoneButton(), null);
  76.                     this.add(getSpecialEffectComboBox(), null);
  77.             }
  78.      
  79.             /**
  80.              * This method initializes ruleName    
  81.              *      
  82.              * @return javax.swing.JTextField      
  83.              */
  84.             private JTextField getRuleNameField() {
  85.                     if (ruleNameField == null) {
  86.                             ruleNameField = new JTextField();
  87.                             ruleNameField.setBounds(new Rectangle(88, 14, 150, 20));
  88.                     }
  89.                     return ruleNameField;
  90.             }
  91.      
  92.             /**
  93.              * This method initializes valueComboBox      
  94.              *      
  95.              * @return javax.swing.JComboBox      
  96.              */
  97.             private JComboBox getValueComboBox() {
  98.                     if (valueComboBox == null) {
  99.                             valueComboBox = new JComboBox();
  100.                             valueComboBox.setBounds(new Rectangle(21, 60, 58, 20));
  101.                             StaticMethods.addValues(valueComboBox);
  102.                     }
  103.                     return valueComboBox;
  104.             }
  105.      
  106.             /**
  107.              * This method initializes suitComboBox
  108.              *      
  109.              * @return javax.swing.JComboBox      
  110.              */
  111.             private JComboBox getSuitComboBox() {
  112.                     if (suitComboBox == null) {
  113.                             suitComboBox = new JComboBox();
  114.                             suitComboBox.setBounds(new Rectangle(104, 60, 91, 20));
  115.                             StaticMethods.addSuits(suitComboBox);
  116.                     }
  117.                     return suitComboBox;
  118.             }
  119.      
  120.             /**
  121.              * This method initializes doneButton  
  122.              *      
  123.              * @return javax.swing.JButton
  124.              */
  125.             private JButton getDoneButton() {
  126.                     if (doneButton == null) {
  127.                             doneButton = new JButton();
  128.                             doneButton.setBounds(new Rectangle(93, 123, 74, 25));
  129.                             doneButton.setText("DONE");
  130.                     }
  131.                     return doneButton;
  132.             }
  133.      
  134.             /**
  135.              * This method initializes specialEffectComboBox      
  136.              *      
  137.              * @return javax.swing.JComboBox      
  138.              */
  139.             private JComboBox getSpecialEffectComboBox() {
  140.                     if (specialEffectComboBox == null) {
  141.                             specialEffectComboBox = new JComboBox();
  142.                             specialEffectComboBox.setBounds(new Rectangle(136, 95, 128, 20));
  143.                     }
  144.                     return specialEffectComboBox;
  145.             }
  146.      
  147.     }  //  @jve:decl-index=0:visual-constraint="10,10"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement