Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.GridBagLayout;
- import javax.swing.JPanel;
- import java.awt.Dimension;
- import javax.swing.JTextField;
- import java.awt.Rectangle;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JComboBox;
- import javax.swing.JTextArea;
- import javax.swing.JButton;
- public class NewSpecialRulePanel extends JPanel {
- private static final long serialVersionUID = 1L;
- private JTextField ruleNameField = null;
- private JLabel RuleNameLabel = null;
- private JLabel ThenLabel = null;
- private JLabel ifLabel1 = null;
- private JComboBox valueComboBox = null;
- private JLabel ifLabel2 = null;
- private JComboBox suitComboBox = null;
- private JLabel ifLabel3 = null;
- private JButton doneButton = null;
- private JComboBox specialEffectComboBox = null;
- /**
- * This is the default constructor
- */
- @SuppressWarnings("deprecation")
- public static void main(String[] args)
- {
- NewSpecialRulePanel test = new NewSpecialRulePanel();
- JFrame frame = new JFrame();
- frame.add(test);
- frame.show();
- frame.setSize(274,215);
- }
- public NewSpecialRulePanel() {
- super();
- initialize();
- }
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- ifLabel3 = new JLabel();
- ifLabel3.setBounds(new Rectangle(201, 62, 60, 16));
- ifLabel3.setText("is played");
- ifLabel2 = new JLabel();
- ifLabel2.setBounds(new Rectangle(85, 61, 16, 19));
- ifLabel2.setText("of");
- ifLabel1 = new JLabel();
- ifLabel1.setBounds(new Rectangle(3, 61, 16, 20));
- ifLabel1.setText("If");
- ThenLabel = new JLabel();
- ThenLabel.setBounds(new Rectangle(7, 97, 127, 15));
- ThenLabel.setText("Then this happens -->");
- RuleNameLabel = new JLabel();
- RuleNameLabel.setBounds(new Rectangle(13, 16, 70, 16));
- RuleNameLabel.setText("Rule Name:");
- this.setSize(274, 191);
- this.setLayout(null);
- this.add(getRuleNameField(), null);
- this.add(RuleNameLabel, null);
- this.add(ThenLabel, null);
- this.add(ifLabel1, null);
- this.add(getValueComboBox(), null);
- this.add(ifLabel2, null);
- this.add(getSuitComboBox(), null);
- this.add(ifLabel3, null);
- this.add(getDoneButton(), null);
- this.add(getSpecialEffectComboBox(), null);
- }
- /**
- * This method initializes ruleName
- *
- * @return javax.swing.JTextField
- */
- private JTextField getRuleNameField() {
- if (ruleNameField == null) {
- ruleNameField = new JTextField();
- ruleNameField.setBounds(new Rectangle(88, 14, 150, 20));
- }
- return ruleNameField;
- }
- /**
- * This method initializes valueComboBox
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getValueComboBox() {
- if (valueComboBox == null) {
- valueComboBox = new JComboBox();
- valueComboBox.setBounds(new Rectangle(21, 60, 58, 20));
- StaticMethods.addValues(valueComboBox);
- }
- return valueComboBox;
- }
- /**
- * This method initializes suitComboBox
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getSuitComboBox() {
- if (suitComboBox == null) {
- suitComboBox = new JComboBox();
- suitComboBox.setBounds(new Rectangle(104, 60, 91, 20));
- StaticMethods.addSuits(suitComboBox);
- }
- return suitComboBox;
- }
- /**
- * This method initializes doneButton
- *
- * @return javax.swing.JButton
- */
- private JButton getDoneButton() {
- if (doneButton == null) {
- doneButton = new JButton();
- doneButton.setBounds(new Rectangle(93, 123, 74, 25));
- doneButton.setText("DONE");
- }
- return doneButton;
- }
- /**
- * This method initializes specialEffectComboBox
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getSpecialEffectComboBox() {
- if (specialEffectComboBox == null) {
- specialEffectComboBox = new JComboBox();
- specialEffectComboBox.setBounds(new Rectangle(136, 95, 128, 20));
- }
- return specialEffectComboBox;
- }
- } // @jve:decl-index=0:visual-constraint="10,10"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement