Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- /*
- * Created by JFormDesigner on Tue Jun 28 16:19:34 EST 2011
- */
- /**
- * @author Ministry
- */
- public class battleguard extends JFrame {
- public battleguard() {
- initComponents();
- }
- private void startButtonActionPerformed(ActionEvent e) {
- String chosen = logSelect.getSelectedItem().toString();
- if (chosen.equals("Logs")) {
- burn_ID = log_ID;
- } else
- if (chosen.equals("Oak logs")) {
- //etc, etc, etc.
- }
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- label1 = new JLabel();
- logSelect = new JComboBox();
- startButton = new JButton();
- //======== this ========
- setTitle(" ");
- setIconImage(null);
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Logs to burn:");
- //---- logSelect ----
- logSelect.setModel(new DefaultComboBoxModel(new String[] {
- "Logs",
- "Oak logs",
- "Willow logs",
- "Maple logs",
- "Yew logs"
- }));
- //---- startButton ----
- startButton.setText("Start");
- startButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- startButtonActionPerformed(e);
- }
- });
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label1)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(logSelect, 0, 128, Short.MAX_VALUE))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(60, 60, 60)
- .addComponent(startButton, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE)))
- .addContainerGap())
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label1)
- .addComponent(logSelect, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
- .addComponent(startButton)
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- private JLabel label1;
- private JComboBox logSelect;
- private JButton startButton;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
Advertisement
Add Comment
Please, Sign In to add comment