Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 13.96 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package com.overloadGDK;
  2.  
  3. import java.awt.*;
  4. import java.awt.event.*;
  5. import javax.swing.*;
  6.  
  7. @SuppressWarnings("serial")
  8. public class OverloadGUI extends JPanel{
  9.  
  10.         //MAIN TAB PANEL INSTANCE VARIABLES
  11.        
  12.         public static int foodType = 0;
  13.         public static int number = 0;
  14.         public JComboBox fishNumber;
  15.         public JComboBox dragonLevel;
  16.         String[] dragonLevelItems = {"Wilderness Level", "Level : 5", "Level : 13", "Level : 20","Level : 35"};
  17.         static boolean levelFive = false;
  18.         static boolean levelThirteen = false;
  19.         static boolean levelTwenty = false;
  20.         static boolean levelThirtyFive = false;
  21.         public JComboBox foodTypeBox;
  22.         public String[] foodTypeItems = {"Choose Food", "Trout", "Salmon", "Lobster", "Tuna", "Swordfish", "Monkfish", "Shark", "Rocktail"};
  23.         public int[] foodIds = {0, 333, 329, 379, 361, 373, 7946, 385, 15272 };//  
  24.         public JTextField foodAmountTextBox;
  25.         public int troutId = 333;
  26.         public int salmonId = 329;
  27.         public int lobsterId = 379;
  28.         public int tunaId = 361;
  29.         public int swordfishId = 373;
  30.         public int monkfishId = 7946;
  31.         public int sharkId = 385;
  32.         public int rocktailId = 15272;
  33.         public JComboBox bankingMethodBox;
  34.         public String[] bankingMethodItems = {"Banking Method", "Walk to Edge","Amulet of Glory", "Ancient Home Teleport", "Varrack Tab" };
  35.         static boolean walkToEdge = false;
  36.         static boolean gloryTele = false;
  37.         static boolean ancientTele = false;
  38.         static boolean varrockTabTele = false;
  39.         public int[] fishNumbers = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
  40.                         13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 };
  41.         public String[] numberOptions = { "Num of Fish", "1", "2", "3", "4",
  42.                         "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15",
  43.                         "16", "17", "18", "19", "20", "21", "22", "23", "24", "25",
  44.                         "26", "27", "28" };
  45.  
  46.  
  47.         //END OF MAIN TAB PANEL INSTANCE VARIABLES
  48.  
  49.         //START OF LOOP PANEL INSTANCE VARIABLES
  50.  
  51.         public JCheckBox dragonBoneBox;
  52.         public JCheckBox dHideBox;
  53.         public JCheckBox aboveFiveBox;
  54.         public JCheckBox herbBox;
  55.         public JCheckBox effBox;
  56.         public JCheckBox clueScrollBox;
  57.         public JCheckBox crimsonCharmBox;
  58.         public JCheckBox goldCharmBox;
  59.         public JCheckBox blueCharmBox;
  60.         public JCheckBox greenCharmBox;
  61.         static boolean goldCharms = false;
  62.         static boolean crimsonCharms = false;
  63.         static boolean blueCharms = false;
  64.         static boolean greenCharms = false;
  65.         static boolean dragonBones = false;
  66.         static boolean dHide = false;
  67.         static boolean aboveFive = false;
  68.         static boolean herbs = false;
  69.         static boolean clueScrolls = false;
  70.         static boolean effs = false;
  71.         public int dragonSheild = 1540;
  72.         public int dragonBoneId = 536;
  73.         public int greenHideId = 1753;
  74.         public int[] herbsIds = { 211, 217, 21626, 207, 3051, 12174, 3049, 219, 14836 };
  75.         public int aboveFiveId = 1163;
  76.         public int goldCharmsId = 12158;
  77.         public int greenCharmsId = 12159;
  78.         public int redCharmsId = 12160;
  79.         public int blueCharmsId = 12163;
  80.         public int[] effId = { 18778, 18779 };
  81.         public int scrollsId[] = { 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684,
  82.                         2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695,
  83.                         2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706,
  84.                         2707, 2708, 2709, 2710, 2711, 2712, 2713, 2716, 2719, 2722, 2723,
  85.                         2725, 2727, 2729, 2731, 2733, 2735, 2737, 2739, 2741, 2743, 2745,
  86.                         2747, 2773, 2774, 2776, 2778, 2780, 2782, 2783, 2785, 2786, 2788,
  87.                         2790, 2792, 2793, 2794, 2796, 2797, 2799, 2801, 2803, 2805, 2807,
  88.                         2809, 2811, 2813, 2815, 2817, 2819, 2821, 2823, 2825, 2827, 2829,
  89.                         2831, 2833, 2835, 2837, 2839, 2841, 2843, 2845, 2847, 2848, 2849,
  90.                         2851, 2853, 2855, 2856, 2857, 2858, 3490, 3491, 3492, 3493, 3494,
  91.                         3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505,
  92.                         3506, 3507, 3508, 3509, 3510, 3512, 3513, 3514, 3515, 3516, 3518,
  93.                         3520, 3522, 3524, 3525, 3526, 3528, 3530, 3532, 3534, 3536, 3538,
  94.                         3540, 3542, 3544, 3546, 3548, 3550, 3552, 3554, 3556, 3558, 3560,
  95.                         3562, 3564, 3566, 3568, 3570, 3572, 3573, 3574, 3575, 3577, 3579,
  96.                         3580, 3582, 3584, 3586, 3588, 3590, 3592, 3594, 3596, 3598, 3599,
  97.                         3601, 3602, 3604, 3605, 3607, 3609, 3610, 3611, 3612, 3613, 3614,
  98.                         3615, 3616, 3617, 3618, 7236, 7238, 7239, 7241, 7243, 7245, 7247,
  99.                         7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255, 7256, 7258, 7260,
  100.                         7262, 7264, 7266, 7268, 7270, 7272, 7274, 7276, 7278, 7280, 7282,
  101.                         7284, 7286, 7288, 7290, 7292, 7294, 7296, 7298, 7300, 7301, 7303,
  102.                         7304, 7305, 7307, 7309, 7311, 7313, 7315, 10180, 10182, 10184,
  103.                         10186, 10188, 10190, 10192, 10194, 10196, 10198, 10200, 10202,
  104.                         10204, 10206, 10208, 10210, 10212, 10214, 10216, 10218, 10220,
  105.                         10222, 10224, 10226, 10228, 10230, 10232, 10234, 10236, 10238,
  106.                         10240, 10242, 10244, 10246, 10248, 10250, 10252, 10254, 10256,
  107.                         10258, 10260, 10262, 10264, 10266, 10268, 10270, 10272, 10274,
  108.                         10276, 10278, 13010, 13012, 13014, 13016, 13018, 13020, 13022,
  109.                         13024, 13026, 13028, 13030, 13032, 13034, 13036, 13038, 13040,
  110.                         13041, 13042, 13044, 13046, 13048, 13049, 13050, 13051, 13053,
  111.                         13055, 13056, 13058, 13060, 13061, 13063, 13065, 13067, 13068,
  112.                         13069, 13070, 13071, 13072, 13074, 13075, 13076, 13078, 13079,
  113.                         13080, 19043, 19044, 19045, 19046, 19047, 19048, 19049, 19050,
  114.                         19051, 19052, 19053, 19054, 19055, 19056, 19057, 19058, 19059,
  115.                         19060, 19061, 19062, 19063, 19064, 19626, };
  116.  
  117.         //END OF LOOP PANEL INSTANCE VARIABLES
  118.        
  119.         //START OF CREDIT PANEL INSTANCE VARIABLES
  120.  
  121.         public JTextArea creditsBox;
  122.         public String credits = "Current Version 1.0!\nThanks to the people who helped me make this GDK, wouldn't be as good as it is without you! <3 \nLove to:\nKittens!!!!\nPrestige!!!\nand Nebula XD.\nPlease No Hate Meh GDK ane Enjoy bottin! :D";
  123.  
  124.         public OverloadGUI(){
  125.                 setLayout(new FlowLayout());
  126.  
  127.                 bankingMethodBox = new JComboBox(bankingMethodItems);
  128.                 bankingMethodBox.addItemListener(
  129.                                 new ItemListener(){
  130.                                         public void itemStateChanged(ItemEvent event){
  131.                                                 if(bankingMethodBox.getSelectedIndex() == 1){
  132.                                                         walkToEdge = true;
  133.                                                         gloryTele = false;
  134.                                                         ancientTele = false;
  135.                                                         varrockTabTele = false;
  136.                                                 }else if(bankingMethodBox.getSelectedIndex() == 2){
  137.                                                         walkToEdge = false;
  138.                                                         gloryTele = true;
  139.                                                         ancientTele = false;
  140.                                                         varrockTabTele = false;
  141.                                                 }else if(bankingMethodBox.getSelectedIndex() == 3){
  142.                                                         walkToEdge = false;
  143.                                                         gloryTele = false;
  144.                                                         ancientTele = true;
  145.                                                         varrockTabTele = false;
  146.                                                 }else if(bankingMethodBox.getSelectedIndex() == 4){
  147.                                                         walkToEdge = false;
  148.                                                         gloryTele = false;
  149.                                                         ancientTele = false;
  150.                                                         varrockTabTele = true;
  151.                                                 }
  152.                                         }
  153.                                 }              
  154.                                 );
  155.  
  156.                 fishNumber = new JComboBox(numberOptions);
  157.                 fishNumber.addItemListener(new ItemListener() {
  158.                         public void itemStateChanged(ItemEvent event) {
  159.                                 number = fishNumbers[fishNumber.getSelectedIndex()];
  160.                         }
  161.                 });
  162.                
  163.                 foodTypeBox = new JComboBox(foodTypeItems);
  164.                 foodTypeBox.addItemListener(
  165.                                 new ItemListener(){
  166.                                         public void itemStateChanged(ItemEvent event){
  167.                                                 if(foodTypeBox.getSelectedIndex() == 1){
  168.                                                         foodType = troutId;
  169.                                                 }
  170.                                                 else if(foodTypeBox.getSelectedIndex() == 2) {
  171.                                                         foodType = salmonId;
  172.                                                 }
  173.                                                 else if(foodTypeBox.getSelectedIndex() == 3) {
  174.                                                         foodType = lobsterId;
  175.                                                 }
  176.                                                 else if(foodTypeBox.getSelectedIndex() == 4) {
  177.                                                         foodType = tunaId;
  178.                                                 }
  179.                                                 else if(foodTypeBox.getSelectedIndex() == 5) {
  180.                                                         foodType = swordfishId;
  181.                                                 }
  182.                                                 else if(foodTypeBox.getSelectedIndex() == 6) {
  183.                                                         foodType = monkfishId;
  184.                                                 }
  185.                                                 else if(foodTypeBox.getSelectedIndex() == 7) {
  186.                                                         foodType = sharkId;
  187.                                                 }
  188.                                                 else if(foodTypeBox.getSelectedIndex() == 8) {
  189.                                                         foodType = rocktailId;
  190.                                                 }
  191.                                         }
  192.                                 }              
  193.                                 );
  194.  
  195.                 dragonLevel = new JComboBox(dragonLevelItems);
  196.                 dragonLevel.addItemListener(
  197.                                 new ItemListener(){
  198.                                         public void itemStateChanged(ItemEvent event){
  199.                                                 if(dragonLevel.getSelectedIndex() == 1){
  200.                                                         levelFive = true;
  201.                                                         levelThirteen = false;
  202.                                                         levelTwenty = false;
  203.                                                         levelThirtyFive = false;
  204.                                                 }else if(dragonLevel.getSelectedIndex() == 2){
  205.                                                         levelFive = false;
  206.                                                         levelThirteen = true;
  207.                                                         levelTwenty = false;
  208.                                                         levelThirtyFive = false;
  209.                                                 }else if(dragonLevel.getSelectedIndex() == 3){
  210.                                                         levelFive = false;
  211.                                                         levelThirteen = false;
  212.                                                         levelTwenty = true;
  213.                                                         levelThirtyFive = false;
  214.                                                 }else if(dragonLevel.getSelectedIndex() == 4){
  215.                                                         levelFive = false;
  216.                                                         levelThirteen = false;
  217.                                                         levelTwenty = false;
  218.                                                         levelThirtyFive = true;
  219.                                                 }
  220.  
  221.                                         }
  222.                                 }
  223.                                 );
  224.  
  225.                 //END OF MAIN TAB PANEL OBJECTS
  226.  
  227.                 //START OF LOOT TAB PANEL OBJECTS
  228.  
  229.                 dragonBoneBox = new JCheckBox("Take Dragonbones?");
  230.                 dragonBoneBox.addItemListener(
  231.                                 new ItemListener(){
  232.                                         public void itemStateChanged(ItemEvent event){
  233.                                                 if(dragonBoneBox.isSelected()){
  234.                                                         dragonBones = true;
  235.                                                 }else{
  236.                                                         dragonBones = false;
  237.                                                 }
  238.                                         }
  239.                                 }              
  240.                                 );
  241.  
  242.                 dHideBox = new JCheckBox("Take D'hide?");
  243.                 dHideBox.addItemListener(
  244.                                 new ItemListener(){
  245.                                         public void itemStateChanged(ItemEvent event){
  246.                                                 if(dHideBox.isSelected()){
  247.                                                         dHide = true;
  248.                                                 }else{
  249.                                                         dHide = false;
  250.                                                 }
  251.                                         }
  252.                                 }              
  253.                                 );
  254.  
  255.                 aboveFiveBox = new JCheckBox("Above 5k?");
  256.                 aboveFiveBox.addItemListener(
  257.                                 new ItemListener(){
  258.                                         public void itemStateChanged(ItemEvent event){
  259.                                                 if(aboveFiveBox.isSelected()){
  260.                                                         aboveFive = true;
  261.                                                 }else{
  262.                                                         aboveFive = false;
  263.                                                 }
  264.                                         }
  265.                                 }              
  266.                                 );
  267.  
  268.                 effBox = new JCheckBox("Take Effigies?");
  269.                 effBox.addItemListener(
  270.                                 new ItemListener(){
  271.                                         public void itemStateChanged(ItemEvent event){
  272.                                                 if(effBox.isSelected()){
  273.                                                         effs = true;
  274.                                                 }else{
  275.                                                         effs = false;
  276.                                         }
  277.                                         }
  278.                                         }
  279.                                 );
  280.  
  281.                 herbBox = new JCheckBox("Take Herbs?");
  282.                 herbBox.addItemListener(
  283.                                 new ItemListener(){
  284.                                         public void itemStateChanged(ItemEvent event){
  285.                                                 if(herbBox.isSelected()){
  286.                                                         herbs = true;
  287.                                                 }else{
  288.                                                         herbs = false;
  289.                                                 }
  290.                                         }
  291.                                 }              
  292.                                 );
  293.  
  294.                 clueScrollBox = new JCheckBox("Take Clue scrolls?");
  295.                 clueScrollBox.addItemListener(
  296.                                 new ItemListener(){
  297.                                         public void itemStateChanged(ItemEvent event){
  298.                                                 if(clueScrollBox.isSelected()){
  299.                                                         clueScrolls = true;
  300.                                                 }else{
  301.                                                         clueScrolls = false;
  302.                                                 }
  303.                                         }
  304.                                 }              
  305.                                 );
  306.  
  307.                 blueCharmBox = new JCheckBox("Take Blue Charms?");
  308.                 blueCharmBox.addItemListener(
  309.                                 new ItemListener(){
  310.                                         public void itemStateChanged(ItemEvent event){
  311.                                                 if(blueCharmBox.isSelected()){
  312.                                                         blueCharms = true;
  313.                                                 }else{
  314.                                                         blueCharms = false;
  315.                                                 }
  316.                                         }
  317.                                 }              
  318.                                 );
  319.  
  320.                 greenCharmBox = new JCheckBox("Take Green Charms?");
  321.                 greenCharmBox.addItemListener(
  322.                                 new ItemListener(){
  323.                                         public void itemStateChanged(ItemEvent event){
  324.                                                 if(greenCharmBox.isSelected()){
  325.                                                         greenCharms = true;
  326.                                                 }else{
  327.                                                         greenCharms = false;
  328.                                                 }
  329.                                         }
  330.                                 }              
  331.                                 );
  332.  
  333.                 goldCharmBox = new JCheckBox("Take Gold Charms?");
  334.                 goldCharmBox.addItemListener(
  335.                                 new ItemListener(){
  336.                                         public void itemStateChanged(ItemEvent event){
  337.                                                 if(goldCharmBox.isSelected()){
  338.                                                         goldCharms = true;
  339.                                                 }else{
  340.                                                         goldCharms = false;
  341.                                                 }
  342.                                         }
  343.                                 }              
  344.                                 );
  345.  
  346.                 crimsonCharmBox = new JCheckBox("Take Chrimson Charms?");
  347.                 crimsonCharmBox.addItemListener(
  348.                                 new ItemListener(){
  349.                                         public void itemStateChanged(ItemEvent event){
  350.                                                 if(crimsonCharmBox.isSelected()){
  351.                                                         crimsonCharms = true;
  352.                                                 }else{
  353.                                                         crimsonCharms = false;
  354.                                                 }
  355.                                         }
  356.                                 }              
  357.                                 );
  358.  
  359.                 //END OF LOOT TAB PANEL OBJECTS
  360.  
  361.                 //START OF CREDIT TAB PANEL OBJECTS
  362.  
  363.                 creditsBox = new JTextArea(credits);
  364.                 creditsBox.setSize(400,140);
  365.                 creditsBox.setEditable(false);
  366.                 creditsBox.setLineWrap(true);
  367.  
  368.                 //END OF CREDIT TAB PANEL OBJECTS
  369.  
  370.                 JTabbedPane tabbedPane = new JTabbedPane();
  371.                 add(tabbedPane);
  372.                 JComponent main = mainPanel();
  373.                 main.setPreferredSize(new Dimension(410,150));
  374.                 tabbedPane.addTab("Main", main);
  375.  
  376.                 JComponent loot = lootPanel();
  377.                 loot.setPreferredSize(new Dimension(410,150));
  378.                 tabbedPane.addTab("Loot", loot);
  379.  
  380.                 JComponent credit = creditPanel();
  381.                 credit.setPreferredSize(new Dimension(410,150));
  382.                 tabbedPane.addTab("Credits", credit);
  383.         }
  384.  
  385.         JComponent mainPanel(){
  386.                 JPanel panel = new JPanel();
  387.                 panel.add(dragonLevel);
  388.                 panel.add(foodTypeBox);
  389.                 panel.add(fishNumber);
  390.                 panel.add(bankingMethodBox);
  391.                 return panel;
  392.         }
  393.  
  394.         JComponent lootPanel(){
  395.                 JPanel panel = new JPanel();
  396.                 panel.add(dragonBoneBox);
  397.                 panel.add(dHideBox);
  398.                 panel.add(clueScrollBox);
  399.                 panel.add(effBox);
  400.                 panel.add(herbBox);
  401.                 panel.add(crimsonCharmBox);
  402.                 panel.add(greenCharmBox);
  403.                 panel.add(goldCharmBox);
  404.                 panel.add(blueCharmBox);
  405.                 panel.add(aboveFiveBox);
  406.                 return panel;
  407.         }
  408.  
  409.         JComponent creditPanel(){
  410.                 JPanel panel = new JPanel();
  411.                 panel.add(new JScrollPane(creditsBox));
  412.                 return panel;
  413.         }
  414.  
  415. }
  416.  
  417. @SuppressWarnings("serial")
  418. class mainFrame extends JFrame{
  419.  
  420.         public JLabel pic;
  421.         public OverloadGUI gui;
  422.         public JLabel icon;
  423.         public JButton startButton;
  424.         public int fishNumber = 0;
  425.        
  426.         public mainFrame(){
  427.                 super("GDK Settings");
  428.                 setSize(500,450);
  429.                 setLocation(410,225);
  430.                 setResizable(false);
  431.  
  432.                 gui = new OverloadGUI();
  433.                 icon = new JLabel("<html><img src=\"http://i614.photobucket.com/albums/tt222/Ecosrage/OvlGdkLOGO.png\"></img></html>\n");
  434.  
  435.                 startButton = new JButton("Start Overload GDK");
  436.                 startButton.addActionListener(
  437.                                 new ActionListener(){
  438.                                         public void actionPerformed(ActionEvent event){
  439.                                                 if(gui.dragonLevel.getSelectedIndex() != 0 && gui.foodTypeBox.getSelectedIndex() != 0 && gui.bankingMethodBox.getSelectedIndex() != 0){
  440.                                                         dispose();
  441.                                                 }else{
  442.                                                         JOptionPane.showMessageDialog(null, "You Missed Something!", "Error", JOptionPane.ERROR_MESSAGE);
  443.                                                 }
  444.                                                
  445.                                         }
  446.                                 }
  447.                                 );
  448.  
  449.                 add(icon, BorderLayout.NORTH);
  450.                 add(gui, BorderLayout.CENTER);
  451.                 add(startButton, BorderLayout.SOUTH);
  452.         }
  453. }