Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class gui extends JFrame {
- public gui() {
- initComponents();
- }
- private void startButtonActionPerformed(ActionEvent e) {
- if (whichMethod.getSelectedIndex() == 0) {
- power = true;
- } else {
- power = false;
- }
- setVisible(false);
- }
- private void initComponents() {
- label1 = new JLabel();
- label2 = new JLabel();
- whichMethod = new JComboBox();
- startButton = new JButton();
- //======== this ========
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- //---- label1 ----
- label1.setText("SimplyMiner by Simply Pro");
- label1.setFont(new Font("Tahoma", Font.BOLD, 22));
- contentPane.add(label1);
- label1.setBounds(40, 0, 330, 70);
- //---- label2 ----
- label2.setText("Which Method?");
- contentPane.add(label2);
- label2.setBounds(20, 100, 85, 35);
- //---- whichMethod ----
- whichMethod.setModel(new DefaultComboBoxModel(new String[] {
- "Powermine",
- "Banking"
- }));
- contentPane.add(whichMethod);
- whichMethod.setBounds(110, 110, 110, 25);
- //---- startButton ----
- startButton.setText("Start Script!");
- startButton.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- startButtonActionPerformed(e);
- }
- });
- contentPane.add(startButton);
- startButton.setBounds(105, 185, 120, 53);
- { // 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(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- private JLabel label1;
- private JLabel label2;
- private JComboBox whichMethod;
- private JButton startButton;
- // JFormDesigner - End of variables declaration //GEN-END:variables
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement