Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.*;
- import javax.swing.GroupLayout;
- /*
- * Created by JFormDesigner on Fri Jan 08 19:33:36 EST 2016
- */
- public class UI extends JFrame {
- /**
- *
- */
- private static final long serialVersionUID = -7712245177636730906L;
- public UI() {
- initComponents();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- label1 = new JLabel();
- button1 = new JButton();
- label2 = new JLabel();
- comboBox1 = new JComboBox<>();
- label3 = new JLabel();
- comboBox2 = new JComboBox<>();
- radioButton1 = new JRadioButton();
- radioButton2 = new JRadioButton();
- checkBox1 = new JCheckBox();
- slider1 = new JSlider();
- label5 = new JLabel();
- radioButton3 = new JRadioButton();
- radioButton4 = new JRadioButton();
- slider2 = new JSlider();
- //======== this ========
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Paradox Simple Fisher");
- label1.setFont(new Font("Lobster 1.4", Font.PLAIN, 48));
- label1.setForeground(Color.cyan);
- label1.setIcon(new ImageIcon(getClass().getResource("/title.png")));
- //---- button1 ----
- button1.setText("Start Script");
- button1.setEnabled(false);
- button1.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- dispose();
- }
- });
- //---- label2 ----
- label2.setText("Catch ");
- label2.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
- //---- comboBox1 ----
- comboBox1.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Shrimps <Anchovies>",
- "Sardines <Herring>"
- }));
- //---- label3 ----
- label3.setText("In");
- label3.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
- //---- comboBox2 ----
- comboBox2.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
- comboBox2.setModel(new DefaultComboBoxModel<>(new String[] {
- "Draynor",
- "Edgeville",
- "Karamja",
- "Catherby",
- "Fishing Guild",
- "Lumbridge",
- "Lumbridge Swamp"
- }));
- comboBox2.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- String sel = comboBox2.getSelectedItem().toString();
- switch (sel) {
- case "Draynor":
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Shrimps <Anchovies>",
- "Sardines <Herring>"
- }));
- break;
- case "Karamja":
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Lobsters",
- "Tuna <Swordfish>"
- }));
- break;
- case "Catherby":
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Shrimps <Anchovies>",
- "Sardines <Herring>",
- "Lobsters",
- "Tuna <Swordfish>",
- "Mackerel <Cod, Bass>",
- "Sharks"
- }));
- break;
- case "Fishing Guild":
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Lobsters",
- "Tuna <Swordfish>",
- "Mackerel <Cod, Bass>",
- "Sharks"
- }));
- break;
- case "Lumbridge":
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Trout <Salmon>",
- "Tuna <Swordfish>"
- }));
- break;
- case "Edgeville":
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Sardines <Herring>",
- "Trout <Salmon>"
- }));
- break;
- case "Lumbridge Swamp":
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Shrimp <Anchovies>"
- }));
- default:
- comboBox2.setSelectedIndex(0);
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Shrimps <Anchovies>",
- "Sardines <Herring>"
- }));
- }
- }
- });
- //---- radioButton1 ----
- radioButton1.setText("Bank");
- radioButton1.setSelected(true);
- radioButton1.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
- //---- radioButton2 ----
- radioButton2.setText("Drop");
- radioButton2.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
- //---- checkBox1 ----
- checkBox1.setText("Set a goal");
- checkBox1.setFont(new Font("Trebuchet MS", Font.PLAIN, 16));
- //---- slider1 ----
- slider1.setMaximum(99);
- slider1.setMinimum(2);
- //---- label5 ----
- label5.setText("or");
- label5.setFont(new Font("Trebuchet MS", Font.PLAIN, 12));
- //---- radioButton3 ----
- radioButton3.setText("Stop script at Level [ 50 ] Fishing");
- radioButton3.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
- radioButton3.setSelected(true);
- //---- radioButton4 ----
- radioButton4.setText("Stop script after catching [ 5000 ] Fish");
- radioButton4.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
- //---- slider2 ----
- slider2.setMaximum(10000);
- slider2.setMinimum(500);
- slider2.setValue(5000);
- slider2.setSnapToTicks(true);
- slider2.setPaintLabels(true);
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(13, 13, 13)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(checkBox1)
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addComponent(label2)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(label3)
- .addGap(12, 12, 12)
- .addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(21, 21, 21)
- .addComponent(radioButton3))))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(128, 128, 128)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addGroup(GroupLayout.Alignment.LEADING, contentPaneLayout.createSequentialGroup()
- .addComponent(radioButton1)
- .addGap(64, 64, 64)
- .addComponent(radioButton2))
- .addComponent(button1, GroupLayout.PREFERRED_SIZE, 182, GroupLayout.PREFERRED_SIZE)))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(163, 163, 163)
- .addComponent(label5))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(34, 34, 34)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(slider1, GroupLayout.PREFERRED_SIZE, 335, GroupLayout.PREFERRED_SIZE)
- .addComponent(radioButton4)
- .addComponent(slider2, GroupLayout.PREFERRED_SIZE, 335, GroupLayout.PREFERRED_SIZE))))
- .addContainerGap(12, Short.MAX_VALUE))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addGap(0, 10, Short.MAX_VALUE)
- .addComponent(label1, GroupLayout.PREFERRED_SIZE, 445, GroupLayout.PREFERRED_SIZE))
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addComponent(label1, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE)
- .addGap(29, 29, 29)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label2)
- .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(label3))
- .addGap(18, 18, 18)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(radioButton1)
- .addComponent(radioButton2))
- .addGap(12, 12, 12)
- .addComponent(checkBox1)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(radioButton3)
- .addGap(9, 9, 9)
- .addComponent(slider1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addGap(10, 10, 10)
- .addComponent(label5)
- .addGap(4, 4, 4)
- .addComponent(radioButton4)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(slider2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
- .addComponent(button1, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- private JLabel label1;
- private JButton button1;
- private JLabel label2;
- private JComboBox<String> comboBox1;
- private JLabel label3;
- private JComboBox<String> comboBox2;
- private JRadioButton radioButton1;
- private JRadioButton radioButton2;
- private JCheckBox checkBox1;
- private JSlider slider1;
- private JLabel label5;
- private JRadioButton radioButton3;
- private JRadioButton radioButton4;
- private JSlider slider2;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement