Advertisement
joedezzy1

GUI

Jul 21st, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.75 KB | None | 0 0
  1. package scripts.autoAlcherPro;
  2.  
  3. import java.awt.Dimension;
  4. import java.awt.GridLayout;
  5. import java.awt.event.ActionEvent;
  6. import java.awt.event.ActionListener;
  7.  
  8. import javax.swing.JButton;
  9. import javax.swing.JCheckBox;
  10. import javax.swing.JFrame;
  11. import javax.swing.JLabel;
  12. import javax.swing.JPanel;
  13. import javax.swing.JTabbedPane;
  14. import javax.swing.JTextField;
  15.  
  16. public class GUI extends JFrame {
  17.  
  18.     private static final long serialVersionUID = 1L;
  19.     private JTabbedPane main;
  20.     private JPanel antiban;
  21.     private JTextField itemName;
  22.     private JLabel itemLabel;
  23.     private JCheckBox walkAlch;
  24.    
  25.     private JCheckBox preformXp;
  26.     private JCheckBox preformCamera;
  27.     private JCheckBox preformClan;
  28.     private JCheckBox preformPm;
  29.     private JCheckBox preformFriendsCheck;
  30.     private JLabel abanFreq;
  31.     private JTextField freqMin;
  32.     private JTextField freqMax;
  33.     private JLabel walkTimeLabel;
  34.     private JLabel to;
  35.     private JTextField walkMin;
  36.     private JTextField walkMax;
  37.     private JButton startButton;
  38.    
  39.     private JPanel mainTab;
  40.    
  41.     private AutoAlcher alcher = new AutoAlcher();
  42.    
  43.     public GUI() {
  44.         setName("JoeDezzy's AutoAlcher");
  45.         setPreferredSize(new Dimension(300, 350));
  46.         addComponents();
  47.         setVisible(true);
  48.     }
  49.  
  50.     private void addComponents() {
  51.        
  52.         //main pane
  53.         main = new JTabbedPane();
  54.        
  55.         mainTab = new JPanel();
  56.         mainTab.setName("Main");
  57.         mainTab.setLayout(new GridLayout(10, 10));
  58.        
  59.         itemLabel = new JLabel();
  60.         itemLabel.setLocation(20, 100);
  61.         itemLabel.setText("Item name: ");
  62.         itemLabel.setVisible(true);    
  63.         mainTab.add(itemLabel);
  64.        
  65.        
  66.         itemName = new JTextField();
  67.         itemName.setLocation(100, 100);
  68.         itemName.setColumns(10);
  69.         itemName.setVisible(true);
  70.         mainTab.add(itemName);
  71.        
  72.         walkTimeLabel = new JLabel();
  73.         walkTimeLabel.setText("Walking sleep time: (Timeout to do alchs)");
  74.         walkTimeLabel.setLocation(400, 100);
  75.         walkTimeLabel.setVisible(false);
  76.         mainTab.add(walkTimeLabel);
  77.        
  78.         walkAlch = new JCheckBox();
  79.         walkMin = new JTextField();
  80.         walkMax = new JTextField();
  81.         walkMin.setVisible(false);
  82.         walkMax.setVisible(false);
  83.         to = new JLabel("to:");
  84.         to.setVisible(false);
  85.        
  86.         walkAlch.setLocation(20, 250);
  87.         walkAlch.setText("Walk alching?");
  88.         walkAlch.addActionListener(new ActionListener(){
  89.             @Override
  90.             public void actionPerformed(ActionEvent e) {
  91.                 if (walkAlch.isSelected()) {
  92.                     walkTimeLabel.setVisible(true);
  93.                     walkMin.setVisible(true);
  94.                     walkMax.setVisible(true);
  95.                     to.setVisible(true);
  96.                 }
  97.                 else {
  98.                     walkTimeLabel.setVisible(false);
  99.                     walkMin.setVisible(false);
  100.                     walkMax.setVisible(false);
  101.                     to.setVisible(false);
  102.                 }
  103.             }  
  104.         });
  105.         mainTab.add(walkMin);
  106.         mainTab.add(to);
  107.         mainTab.add(walkMax);
  108.         mainTab.add(walkAlch);
  109.        
  110.         startButton = new JButton();
  111.         startButton.setLocation(250, 400);
  112.         startButton.setSize(100, 50);
  113.         startButton.setText("Start!");
  114.         startButton.addActionListener(new ActionListener(){
  115.             @Override
  116.             public void actionPerformed(ActionEvent e) {
  117.                 alcher.sendValues(walkAlch.isSelected() ? true : false,
  118.                         walkAlch.isSelected() ? Integer.parseInt(walkMin.getText()) : 0,
  119.                         walkAlch.isSelected() ? Integer.parseInt(walkMax.getText()) : 0,
  120.                         itemName.getText());
  121.                 alcher.GUI_COMPLETE = true;            
  122.             }
  123.         });
  124.         mainTab.add(startButton);      
  125.         main.add(mainTab);
  126.        
  127.         antiban = new JPanel();
  128.         antiban.setName("Antiban");
  129.         antiban.setLayout(new GridLayout(10,10));
  130.        
  131.         preformXp = new JCheckBox("Preform xp check? ");
  132.         preformXp.setLocation(20, 40);
  133.         preformXp.setVisible(true);
  134.         preformCamera = new JCheckBox("Preform camera movements? ");
  135.         preformCamera.setLocation(20, 80);
  136.         preformCamera.setVisible(true);
  137.         preformClan = new JCheckBox("Join random chat channels? ");
  138.         preformClan.setLocation(20, 120);
  139.         preformClan.setVisible(true);
  140.         preformPm = new JCheckBox("Preform random pms? ");
  141.         preformPm.setLocation(20, 160);
  142.         preformPm.setVisible(true);
  143.         preformFriendsCheck = new JCheckBox("Preform friends check? ");
  144.         preformFriendsCheck.setLocation(20, 200);
  145.         preformFriendsCheck.setVisible(true);
  146.        
  147.         abanFreq = new JLabel("Antiban frequency (in seconds): ");
  148.         //abanFreq.setLocation(20, 20);
  149.         abanFreq.setVisible(true);
  150.        
  151.         freqMin = new JTextField(5);
  152.         freqMin.setVisible(true);
  153.         freqMax = new JTextField(5);
  154.         freqMax.setVisible(true);
  155.        
  156.         JLabel to2 = new JLabel("to: ");
  157.         to2.setVisible(true);
  158.        
  159.        
  160.         antiban.add(preformXp);
  161.         antiban.add(preformCamera);
  162.         antiban.add(preformClan);
  163.         antiban.add(preformPm);
  164.         antiban.add(preformFriendsCheck);
  165.         antiban.add(abanFreq);
  166.         antiban.add(freqMin);
  167.         antiban.add(to2);
  168.         antiban.add(freqMax);
  169.    
  170.        
  171.         main.addTab("Antiban", antiban);
  172.        
  173.         add(main);
  174.         setLocationRelativeTo(null);
  175.         pack();
  176.     }
  177. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement