Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts.CrabKiller;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- public class GUI extends JFrame {
- public GUI() {
- initComponents();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY
- // //GEN-BEGIN:initComponents
- // Generated using JFormDesigner Evaluation license - Will Baker
- checkBox1 = new JCheckBox();
- checkBox2 = new JCheckBox();
- label1 = new JLabel();
- textField1 = new JTextField();
- button1 = new JButton();
- textField2 = new JTextField();
- label2 = new JLabel();
- // ======== this ========
- setTitle("wbCrabKiller Settings");
- setResizable(false);
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- // ---- checkBox1 ----
- checkBox1.setText("Eating?");
- contentPane.add(checkBox1);
- checkBox1.setBounds(new Rectangle(new Point(135, 95), checkBox1
- .getPreferredSize()));
- // ---- checkBox2 ----
- checkBox2.setText("Banking?");
- contentPane.add(checkBox2);
- checkBox2.setBounds(15, 95, 80, 23);
- // ---- label1 ----
- label1.setText("Food ID:");
- contentPane.add(label1);
- label1.setBounds(15, 10, 42, 30);
- contentPane.add(textField1);
- textField1.setBounds(165, 15, 200, 20);
- // ---- button1 ----
- button1.setText("Start");
- button1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if( checkBox2.isSelected()) {
- UserVariables.foodID = Integer.parseInt(textField1.getText());
- UserVariables.foodWithdrawAmmount = Integer.parseInt(textField2.getText());
- }
- UserVariables.eating = checkBox1.isSelected();
- UserVariables.running = true;
- setVisible(false);
- dispose();
- }
- });
- contentPane.add(button1);
- button1.setBounds(260, 85, 105, 35);
- contentPane.add(textField2);
- textField2.setBounds(165, 40, 200, 20);
- // ---- label2 ----
- label2.setText("Food withdraw ammount:");
- contentPane.add(label2);
- label2.setBounds(15, 40, 130, 25);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for (int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width,
- preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height,
- preferredSize.height);
- }
- Insets insets = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- pack();
- setLocationRelativeTo(null);
- // JFormDesigner - End of component initialization
- // //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY
- // //GEN-BEGIN:variables
- // Generated using JFormDesigner Evaluation license - Will Baker
- private JCheckBox checkBox1;
- private JCheckBox checkBox2;
- private JLabel label1;
- private JTextField textField1;
- private JButton button1;
- private JTextField textField2;
- private JLabel label2;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement