Ministry

Untitled

Jun 28th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.02 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import javax.swing.*;
  4. /*
  5.  * Created by JFormDesigner on Tue Jun 28 16:19:34 EST 2011
  6.  */
  7.  
  8.  
  9.  
  10. /**
  11.  * @author Ministry
  12.  */
  13. public class battleguard extends JFrame {
  14.     public battleguard() {
  15.         initComponents();
  16.     }
  17.  
  18.     private void startButtonActionPerformed(ActionEvent e) {
  19.             String chosen = logSelect.getSelectedItem().toString();
  20.         if (chosen.equals("Logs")) {
  21.                     burn_ID = log_ID;
  22.                 } else
  23.                     if (chosen.equals("Oak logs")) {
  24.                         //etc, etc, etc.
  25.                     }
  26.     }
  27.  
  28.     private void initComponents() {
  29.         // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
  30.         label1 = new JLabel();
  31.         logSelect = new JComboBox();
  32.         startButton = new JButton();
  33.  
  34.         //======== this ========
  35.         setTitle(" ");
  36.         setIconImage(null);
  37.         Container contentPane = getContentPane();
  38.  
  39.         //---- label1 ----
  40.         label1.setText("Logs to burn:");
  41.  
  42.         //---- logSelect ----
  43.         logSelect.setModel(new DefaultComboBoxModel(new String[] {
  44.             "Logs",
  45.             "Oak logs",
  46.             "Willow logs",
  47.             "Maple logs",
  48.             "Yew logs"
  49.         }));
  50.  
  51.         //---- startButton ----
  52.         startButton.setText("Start");
  53.         startButton.addActionListener(new ActionListener() {
  54.             public void actionPerformed(ActionEvent e) {
  55.                 startButtonActionPerformed(e);
  56.             }
  57.         });
  58.  
  59.         GroupLayout contentPaneLayout = new GroupLayout(contentPane);
  60.         contentPane.setLayout(contentPaneLayout);
  61.         contentPaneLayout.setHorizontalGroup(
  62.             contentPaneLayout.createParallelGroup()
  63.                 .addGroup(contentPaneLayout.createSequentialGroup()
  64.                     .addGroup(contentPaneLayout.createParallelGroup()
  65.                         .addGroup(contentPaneLayout.createSequentialGroup()
  66.                             .addContainerGap()
  67.                             .addComponent(label1)
  68.                             .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  69.                             .addComponent(logSelect, 0, 128, Short.MAX_VALUE))
  70.                         .addGroup(contentPaneLayout.createSequentialGroup()
  71.                             .addGap(60, 60, 60)
  72.                             .addComponent(startButton, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE)))
  73.                     .addContainerGap())
  74.         );
  75.         contentPaneLayout.setVerticalGroup(
  76.             contentPaneLayout.createParallelGroup()
  77.                 .addGroup(contentPaneLayout.createSequentialGroup()
  78.                     .addContainerGap()
  79.                     .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  80.                         .addComponent(label1)
  81.                         .addComponent(logSelect, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  82.                     .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
  83.                     .addComponent(startButton)
  84.                     .addContainerGap())
  85.         );
  86.         pack();
  87.         setLocationRelativeTo(getOwner());
  88.         // JFormDesigner - End of component initialization  //GEN-END:initComponents
  89.     }
  90.  
  91.     // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
  92.     private JLabel label1;
  93.     private JComboBox logSelect;
  94.     private JButton startButton;
  95.     // JFormDesigner - End of variables declaration  //GEN-END:variables
  96. }
Advertisement
Add Comment
Please, Sign In to add comment