Guest User

Untitled

a guest
Dec 10th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import javax.swing.*;
  4. import com.jgoodies.forms.factories.*;
  5. import com.jgoodies.forms.layout.*;
  6. /*
  7. * Created by JFormDesigner on Tue Sep 06 18:37:16 CDT 2011
  8. */
  9.  
  10.  
  11.  
  12. /**
  13. * @author Tim
  14. */
  15. public class gui extends JFrame {
  16. public gui() {
  17. initComponents();
  18. }
  19.  
  20. private void button1ActionPerformed(ActionEvent e) {
  21. //Get food id
  22. tempfoodID = textField1.getText();
  23. Vars.FoodID = Integer.parseInt(tempfoodID);
  24. //Check for Revenant lvl
  25. if (comboBox1.equals("Easy")){
  26. Vars.RevLvl = 1;
  27. }else if (comboBox1.equals("Medium")){
  28. Vars.RevLvl = 2;
  29. }else if (comboBox1.equals("Hard")){
  30. Vars.RevLvl = 3;
  31. }else Vars.RevLvl = 2;
  32. //Check for Repeling
  33. if (comboBox2.equals("No")){
  34. Vars.BraceRepel = false;
  35. }else if (comboBox2.equals("Yes")){
  36. Vars.BraceRepel = true;
  37. }else Vars.BraceRepel = false;
  38. //Check Banking method
  39. if (comboBox3.equals("Walk")){
  40. Vars.Banking = 1;
  41. }else if (comboBox3.equals("Glory")){
  42. Vars.Banking = 2;
  43. }else if (comboBox3.equals("Varrock Tab")){
  44. Vars.Banking = 3;
  45. }else Vars.Banking = 1;
  46.  
  47. dispose();
  48.  
  49. }
  50.  
  51. private void initComponents() {
  52. // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
  53. // Generated using JFormDesigner Evaluation license - Tim Christensen
  54. label1 = new JLabel();
  55. textField1 = new JTextField();
  56. label2 = new JLabel();
  57. comboBox1 = new JComboBox();
  58. label3 = new JLabel();
  59. comboBox2 = new JComboBox();
  60. label4 = new JLabel();
  61. comboBox3 = new JComboBox();
  62. button1 = new JButton();
  63.  
  64. //======== this ========
  65. setTitle("Thunder Revenants");
  66. Container contentPane = getContentPane();
  67. contentPane.setLayout(new FormLayout(
  68. "4*(default, $lcgap), 19dlu",
  69. "5*(default, $lgap), default"));
  70.  
  71. //---- label1 ----
  72. label1.setText("Food ID: ");
  73. contentPane.add(label1, CC.xy(3, 3));
  74. contentPane.add(textField1, CC.xy(7, 3));
  75.  
  76. //---- label2 ----
  77. label2.setText("Revenant Lvl:");
  78. contentPane.add(label2, CC.xy(3, 5));
  79.  
  80. //---- comboBox1 ----
  81. comboBox1.setModel(new DefaultComboBoxModel(new String[] {
  82. "Easy",
  83. "Medium",
  84. "Hard"
  85. }));
  86. contentPane.add(comboBox1, CC.xy(7, 5));
  87.  
  88. //---- label3 ----
  89. label3.setText("Use Brace?:");
  90. contentPane.add(label3, CC.xy(3, 7));
  91.  
  92. //---- comboBox2 ----
  93. comboBox2.setModel(new DefaultComboBoxModel(new String[] {
  94. "Yes",
  95. "No"
  96. }));
  97. contentPane.add(comboBox2, CC.xy(7, 7));
  98.  
  99. //---- label4 ----
  100. label4.setText("Bank Method:");
  101. contentPane.add(label4, CC.xy(3, 9));
  102.  
  103. //---- comboBox3 ----
  104. comboBox3.setModel(new DefaultComboBoxModel(new String[] {
  105. "Walk",
  106. "Glory",
  107. "Varrock Tab"
  108. }));
  109. contentPane.add(comboBox3, CC.xy(7, 9));
  110.  
  111. //---- button1 ----
  112. button1.setText("Start");
  113. button1.addActionListener(new ActionListener() {
  114. @Override
  115. public void actionPerformed(ActionEvent e) {
  116. button1ActionPerformed(e);
  117. }
  118. });
  119. contentPane.add(button1, CC.xy(5, 11));
  120. pack();
  121. setLocationRelativeTo(getOwner());
  122. // JFormDesigner - End of component initialization //GEN-END:initComponents
  123. }
  124.  
  125. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  126. // Generated using JFormDesigner Evaluation license - Tim Christensen
  127. private JLabel label1;
  128. private JTextField textField1;
  129. private JLabel label2;
  130. private JComboBox comboBox1;
  131. private JLabel label3;
  132. private JComboBox comboBox2;
  133. private JLabel label4;
  134. private JComboBox comboBox3;
  135. private JButton button1;
  136. // JFormDesigner - End of variables declaration //GEN-END:variables
  137. }
Add Comment
Please, Sign In to add comment