Advertisement
Guest User

Untitled

a guest
Jan 8th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.61 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.ActionEvent;
  3. import java.awt.event.ActionListener;
  4.  
  5. import javax.swing.*;
  6. import javax.swing.GroupLayout;
  7. /*
  8. * Created by JFormDesigner on Fri Jan 08 19:33:36 EST 2016
  9. */
  10.  
  11.  
  12.  
  13. public class UI extends JFrame {
  14. /**
  15. *
  16. */
  17. private static final long serialVersionUID = -7712245177636730906L;
  18. public UI() {
  19. initComponents();
  20. }
  21.  
  22. private void initComponents() {
  23. // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
  24. label1 = new JLabel();
  25. button1 = new JButton();
  26. label2 = new JLabel();
  27. comboBox1 = new JComboBox<>();
  28. label3 = new JLabel();
  29. comboBox2 = new JComboBox<>();
  30. radioButton1 = new JRadioButton();
  31. radioButton2 = new JRadioButton();
  32. checkBox1 = new JCheckBox();
  33. slider1 = new JSlider();
  34. label5 = new JLabel();
  35. radioButton3 = new JRadioButton();
  36. radioButton4 = new JRadioButton();
  37. slider2 = new JSlider();
  38.  
  39. //======== this ========
  40. Container contentPane = getContentPane();
  41.  
  42. //---- label1 ----
  43. label1.setText("Paradox Simple Fisher");
  44. label1.setFont(new Font("Lobster 1.4", Font.PLAIN, 48));
  45. label1.setForeground(Color.cyan);
  46. label1.setIcon(new ImageIcon(getClass().getResource("/title.png")));
  47.  
  48. //---- button1 ----
  49. button1.setText("Start Script");
  50. button1.setEnabled(false);
  51. button1.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
  52. button1.addActionListener(new ActionListener() {
  53. @Override
  54. public void actionPerformed(ActionEvent e) {
  55. dispose();
  56. }
  57. });
  58.  
  59. //---- label2 ----
  60. label2.setText("Catch ");
  61. label2.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
  62.  
  63. //---- comboBox1 ----
  64. comboBox1.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
  65. comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
  66. "Shrimps <Anchovies>",
  67. "Sardines <Herring>"
  68. }));
  69.  
  70. //---- label3 ----
  71. label3.setText("In");
  72. label3.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
  73.  
  74. //---- comboBox2 ----
  75. comboBox2.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
  76. comboBox2.setModel(new DefaultComboBoxModel<>(new String[] {
  77. "Draynor",
  78. "Edgeville",
  79. "Karamja",
  80. "Catherby",
  81. "Fishing Guild",
  82. "Lumbridge",
  83. "Lumbridge Swamp"
  84. }));
  85. comboBox2.addActionListener(new ActionListener() {
  86. @Override
  87. public void actionPerformed(ActionEvent e) {
  88. String sel = comboBox2.getSelectedItem().toString();
  89. switch (sel) {
  90. case "Draynor":
  91. comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
  92. "Shrimps <Anchovies>",
  93. "Sardines <Herring>"
  94. }));
  95. break;
  96. case "Karamja":
  97. comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
  98. "Lobsters",
  99. "Tuna <Swordfish>"
  100. }));
  101. break;
  102. case "Catherby":
  103. comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
  104. "Shrimps <Anchovies>",
  105. "Sardines <Herring>",
  106. "Lobsters",
  107. "Tuna <Swordfish>",
  108. "Mackerel <Cod, Bass>",
  109. "Sharks"
  110. }));
  111. break;
  112. case "Fishing Guild":
  113. comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
  114. "Lobsters",
  115. "Tuna <Swordfish>",
  116. "Mackerel <Cod, Bass>",
  117. "Sharks"
  118. }));
  119. break;
  120. case "Lumbridge":
  121. comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
  122. "Trout <Salmon>",
  123. "Tuna <Swordfish>"
  124. }));
  125. break;
  126. case "Edgeville":
  127. comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
  128. "Sardines <Herring>",
  129. "Trout <Salmon>"
  130. }));
  131. break;
  132. case "Lumbridge Swamp":
  133. comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
  134. "Shrimp <Anchovies>"
  135. }));
  136. default:
  137. comboBox2.setSelectedIndex(0);
  138. comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
  139. "Shrimps <Anchovies>",
  140. "Sardines <Herring>"
  141. }));
  142. }
  143. }
  144. });
  145.  
  146. //---- radioButton1 ----
  147. radioButton1.setText("Bank");
  148. radioButton1.setSelected(true);
  149. radioButton1.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
  150.  
  151. //---- radioButton2 ----
  152. radioButton2.setText("Drop");
  153. radioButton2.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
  154.  
  155. //---- checkBox1 ----
  156. checkBox1.setText("Set a goal");
  157. checkBox1.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
  158.  
  159. //---- slider1 ----
  160. slider1.setMaximum(99);
  161. slider1.setMinimum(2);
  162.  
  163. //---- label5 ----
  164. label5.setText("or");
  165. label5.setFont(new Font("Trebuchet MS", Font.PLAIN, 12));
  166.  
  167. //---- radioButton3 ----
  168. radioButton3.setText("Stop script at Level [ 50 ] Fishing");
  169. radioButton3.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
  170. radioButton3.setSelected(true);
  171.  
  172. //---- radioButton4 ----
  173. radioButton4.setText("Stop script after catching [ 5000 ] Fish");
  174. radioButton4.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
  175.  
  176. //---- slider2 ----
  177. slider2.setMaximum(10000);
  178. slider2.setMinimum(500);
  179. slider2.setValue(5000);
  180. slider2.setSnapToTicks(true);
  181. slider2.setPaintLabels(true);
  182.  
  183. GroupLayout contentPaneLayout = new GroupLayout(contentPane);
  184. contentPane.setLayout(contentPaneLayout);
  185. contentPaneLayout.setHorizontalGroup(
  186. contentPaneLayout.createParallelGroup()
  187. .addGroup(contentPaneLayout.createSequentialGroup()
  188. .addGroup(contentPaneLayout.createParallelGroup()
  189. .addGroup(contentPaneLayout.createSequentialGroup()
  190. .addGap(13, 13, 13)
  191. .addGroup(contentPaneLayout.createParallelGroup()
  192. .addComponent(checkBox1)
  193. .addGroup(contentPaneLayout.createSequentialGroup()
  194. .addComponent(label2)
  195. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  196. .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  197. .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  198. .addComponent(label3)
  199. .addGap(12, 12, 12)
  200. .addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  201. .addGroup(contentPaneLayout.createSequentialGroup()
  202. .addGap(21, 21, 21)
  203. .addComponent(radioButton3))))
  204. .addGroup(contentPaneLayout.createSequentialGroup()
  205. .addGap(128, 128, 128)
  206. .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  207. .addGroup(GroupLayout.Alignment.LEADING, contentPaneLayout.createSequentialGroup()
  208. .addComponent(radioButton1)
  209. .addGap(64, 64, 64)
  210. .addComponent(radioButton2))
  211. .addComponent(button1, GroupLayout.PREFERRED_SIZE, 182, GroupLayout.PREFERRED_SIZE)))
  212. .addGroup(contentPaneLayout.createSequentialGroup()
  213. .addGap(163, 163, 163)
  214. .addComponent(label5))
  215. .addGroup(contentPaneLayout.createSequentialGroup()
  216. .addGap(34, 34, 34)
  217. .addGroup(contentPaneLayout.createParallelGroup()
  218. .addComponent(slider1, GroupLayout.PREFERRED_SIZE, 335, GroupLayout.PREFERRED_SIZE)
  219. .addComponent(radioButton4)
  220. .addComponent(slider2, GroupLayout.PREFERRED_SIZE, 335, GroupLayout.PREFERRED_SIZE))))
  221. .addContainerGap(12, Short.MAX_VALUE))
  222. .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  223. .addGap(0, 10, Short.MAX_VALUE)
  224. .addComponent(label1, GroupLayout.PREFERRED_SIZE, 445, GroupLayout.PREFERRED_SIZE))
  225. );
  226. contentPaneLayout.setVerticalGroup(
  227. contentPaneLayout.createParallelGroup()
  228. .addGroup(contentPaneLayout.createSequentialGroup()
  229. .addComponent(label1, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE)
  230. .addGap(29, 29, 29)
  231. .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  232. .addComponent(label2)
  233. .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  234. .addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  235. .addComponent(label3))
  236. .addGap(18, 18, 18)
  237. .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  238. .addComponent(radioButton1)
  239. .addComponent(radioButton2))
  240. .addGap(12, 12, 12)
  241. .addComponent(checkBox1)
  242. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  243. .addComponent(radioButton3)
  244. .addGap(9, 9, 9)
  245. .addComponent(slider1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  246. .addGap(10, 10, 10)
  247. .addComponent(label5)
  248. .addGap(4, 4, 4)
  249. .addComponent(radioButton4)
  250. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  251. .addComponent(slider2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  252. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
  253. .addComponent(button1, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE)
  254. .addContainerGap())
  255. );
  256. pack();
  257. setLocationRelativeTo(getOwner());
  258. // JFormDesigner - End of component initialization //GEN-END:initComponents
  259. }
  260.  
  261. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  262. private JLabel label1;
  263. private JButton button1;
  264. private JLabel label2;
  265. private JComboBox<String> comboBox1;
  266. private JLabel label3;
  267. private JComboBox<String> comboBox2;
  268. private JRadioButton radioButton1;
  269. private JRadioButton radioButton2;
  270. private JCheckBox checkBox1;
  271. private JSlider slider1;
  272. private JLabel label5;
  273. private JRadioButton radioButton3;
  274. private JRadioButton radioButton4;
  275. private JSlider slider2;
  276. // JFormDesigner - End of variables declaration //GEN-END:variables
  277. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement