Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.ButtonGroup;
- //import javax.swing.ButtonModel;
- import javax.swing.JButton;
- //import javax.swing.JComboBox;
- import javax.swing.JFrame;
- //import javax.swing.JLabel;
- //import javax.swing.JPanel;
- //import javax.swing.JSpinner;
- //import javax.swing.SpinnerModel;
- //import javax.swing.SpinnerNumberModel;
- import javax.swing.JRadioButton;
- import java.awt.Font;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.ItemEvent;
- import java.awt.event.ItemListener;
- //import java.awt.event.ActionListener;
- //import java.awt.event.ActionEvent;
- import javax.swing.JCheckBox;
- import javax.swing.JTextPane;
- import javax.swing.JSpinner;
- import javax.swing.SpinnerNumberModel;
- import java.awt.Checkbox;
- import java.awt.Component;
- public class SettingsGUI {
- /**
- * @wbp.parser.entryPoint
- */
- public static void Window(main m) {
- JFrame jFrame = new JFrame("Curtidor");
- jFrame.getContentPane().setEnabled(false);
- jFrame.setSize(261, 419);
- jFrame.setResizable(false);
- jFrame.getContentPane().setLayout(null);
- JRadioButton rdbtnLeather = new JRadioButton("Leather");
- rdbtnLeather.setSelected(true);
- rdbtnLeather.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnLeather.setBounds(6, 25, 109, 23);
- jFrame.getContentPane().add(rdbtnLeather);
- JRadioButton rdbtnHardLeather = new JRadioButton("Hard Leather");
- rdbtnHardLeather.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnHardLeather.setBounds(128, 25, 109, 23);
- jFrame.getContentPane().add(rdbtnHardLeather);
- JRadioButton rdbtnGreenDhide = new JRadioButton("Green D'Hide");
- rdbtnGreenDhide.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnGreenDhide.setBounds(6, 51, 109, 23);
- jFrame.getContentPane().add(rdbtnGreenDhide);
- JRadioButton rdbtnBlueDhide = new JRadioButton("Blue D'Hide");
- rdbtnBlueDhide.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnBlueDhide.setBounds(128, 51, 109, 23);
- jFrame.getContentPane().add(rdbtnBlueDhide);
- JRadioButton rdbtnRedDhide = new JRadioButton("Red D'Hide");
- rdbtnRedDhide.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnRedDhide.setBounds(6, 77, 109, 23);
- jFrame.getContentPane().add(rdbtnRedDhide);
- JRadioButton rdbtnBlackDhide = new JRadioButton("Black D'Hide");
- rdbtnBlackDhide.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnBlackDhide.setBounds(128, 77, 109, 23);
- jFrame.getContentPane().add(rdbtnBlackDhide);
- JCheckBox chckbxAutoGE = new JCheckBox("Auto G/E");
- chckbxAutoGE.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- chckbxAutoGE.setBounds(6, 204, 109, 23);
- jFrame.getContentPane().add(chckbxAutoGE);
- JTextPane txtpnSelectWhatYou = new JTextPane();
- txtpnSelectWhatYou.setEditable(false);
- txtpnSelectWhatYou.setFont(new Font("Century Gothic", Font.PLAIN, 13));
- txtpnSelectWhatYou.setText("Select what to tan:");
- txtpnSelectWhatYou.setBounds(6, 5, 239, 23);
- jFrame.getContentPane().add(txtpnSelectWhatYou);
- JTextPane txtpnSelectALocation = new JTextPane();
- txtpnSelectALocation.setEditable(false);
- txtpnSelectALocation.setText("Select a location:");
- txtpnSelectALocation.setFont(new Font("Century Gothic", Font.PLAIN, 13));
- txtpnSelectALocation.setBounds(6, 107, 239, 23);
- jFrame.getContentPane().add(txtpnSelectALocation);
- JCheckBox chckbxEnableMule = new JCheckBox("Enable Mule");
- chckbxEnableMule.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- chckbxEnableMule.setBounds(128, 204, 109, 23);
- jFrame.getContentPane().add(chckbxEnableMule);
- JTextPane txtpnMiscOptions = new JTextPane();
- txtpnMiscOptions.setText("Misc. options:");
- txtpnMiscOptions.setFont(new Font("Century Gothic", Font.PLAIN, 13));
- txtpnMiscOptions.setEditable(false);
- txtpnMiscOptions.setBounds(6, 181, 239, 23);
- jFrame.getContentPane().add(txtpnMiscOptions);
- JRadioButton rdbtnAlKharid = new JRadioButton("Al Kharid");
- rdbtnAlKharid.setSelected(true);
- rdbtnAlKharid.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnAlKharid.setBounds(6, 128, 109, 23);
- jFrame.getContentPane().add(rdbtnAlKharid);
- JRadioButton rdbtnCraftingGuild = new JRadioButton("Crafting Guild");
- rdbtnCraftingGuild.setEnabled(false);
- rdbtnCraftingGuild.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnCraftingGuild.setBounds(128, 129, 109, 23);
- jFrame.getContentPane().add(rdbtnCraftingGuild);
- JRadioButton rdbtnRangingGuild = new JRadioButton("Ranging Guild");
- rdbtnRangingGuild.setEnabled(false);
- rdbtnRangingGuild.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnRangingGuild.setBounds(6, 154, 109, 23);
- jFrame.getContentPane().add(rdbtnRangingGuild);
- JRadioButton rdbtnCanifis = new JRadioButton("Canifis");
- rdbtnCanifis.setEnabled(false);
- rdbtnCanifis.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- rdbtnCanifis.setBounds(128, 155, 109, 23);
- jFrame.getContentPane().add(rdbtnCanifis);
- ButtonGroup group = new ButtonGroup();
- group.add(rdbtnHardLeather);
- group.add(rdbtnLeather);
- group.add(rdbtnGreenDhide);
- group.add(rdbtnBlueDhide);
- group.add(rdbtnRedDhide);
- group.add(rdbtnBlackDhide);
- ButtonGroup group2 = new ButtonGroup();
- group2.add(rdbtnAlKharid);
- group2.add(rdbtnCraftingGuild);
- group2.add(rdbtnRangingGuild);
- group2.add(rdbtnCanifis);
- JSpinner spinnerHides = new JSpinner();
- spinnerHides.setModel(new SpinnerNumberModel(1600, 1, 10000, 50));
- spinnerHides.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- spinnerHides.setBounds(6, 260, 109, 20);
- jFrame.getContentPane().add(spinnerHides);
- JTextPane txtpnMaxAmountOf = new JTextPane();
- txtpnMaxAmountOf.setText("Max amount of hides to buy:");
- txtpnMaxAmountOf.setFont(new Font("Century Gothic", Font.PLAIN, 13));
- txtpnMaxAmountOf.setEditable(false);
- txtpnMaxAmountOf.setBounds(6, 234, 239, 23);
- jFrame.getContentPane().add(txtpnMaxAmountOf);
- //
- JButton btnStartButton = new JButton("Start");
- btnStartButton.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- btnStartButton.setBounds(75, 356, 89, 23);
- jFrame.getContentPane().add(btnStartButton);
- //
- jFrame.setVisible(true);
- /*chckbxAutoGE.addActionListener(e -> {
- if (chckbxAutoGE.isSelected()) {
- spinnerHides.setEnabled(true);
- } else {
- spinnerHides.setEnabled(false);
- }
- });*/
- chckbxAutoGE.addItemListener(new ItemListener() {
- @Override
- public void itemStateChanged(ItemEvent e) {
- if(e.getStateChange() == ItemEvent.SELECTED){
- spinnerHides.setEnabled(true);
- }
- if(e.getStateChange() == ItemEvent.DESELECTED){
- spinnerHides.setEnabled(false);
- }
- }
- });
- btnStartButton.addActionListener(e -> {
- if (rdbtnLeather.isSelected()) {
- m.hideOption = "Soft leather";
- m.hideUsed = "Cowhide";
- m.hideCreated = "Leather";
- m.hideUsedPaintName = "Cowhide";
- m.hidePaintName = "Leather";
- m.hideIdSelling = 1741;
- m.hideIdRaw = 1739;
- m.tanningCost = 1;
- m.buyAbove = 60;
- }
- if (rdbtnHardLeather.isSelected()) {
- m.hideOption = "Hard leather";
- m.hideUsed = "Cowhide";
- m.hideCreated = "Hard leather";
- m.hideUsedPaintName = "Cowhide";
- m.hidePaintName = "Hard Leather";
- m.hideIdSelling = 1743;
- m.hideIdRaw = 1739;
- m.tanningCost = 3;
- m.buyAbove = 60;
- }
- if (rdbtnGreenDhide.isSelected()) {
- m.hideOption = "Green d'hide";
- m.hideUsed = "Green dragonhide";
- m.hideCreated = "Green dragon leather";
- m.hideUsedPaintName = "Green Dragonhide";
- m.hidePaintName = "Green Dragon Leather";
- m.hideIdSelling = 1745;
- m.hideIdRaw = 1753;
- m.tanningCost = 20;
- m.buyAbove = 200;
- }
- if (rdbtnBlueDhide.isSelected()) {
- m.hideOption = "Blue d'hide";
- m.hideUsed = "Blue dragonhide";
- m.hideCreated = "Blue dragon leather";
- m.hideUsedPaintName = "Blue Dragonhide";
- m.hidePaintName = "Blue Dragon Leather";
- m.hideIdSelling = 2505;
- m.hideIdRaw = 1751;
- m.tanningCost = 20;
- m.buyAbove = 200;
- }
- if (rdbtnRedDhide.isSelected()) {
- m.hideOption = "Red d'hide";
- m.hideUsed = "Red dragonhide";
- m.hideCreated = "Red dragon leather";
- m.hideUsedPaintName = "Red Dragonhide";
- m.hidePaintName = "Red Dragon Leather";
- m.hideIdSelling = 2507;
- m.hideIdRaw = 1749;
- m.tanningCost = 20;
- m.buyAbove = 200;
- }
- if (rdbtnBlackDhide.isSelected()) {
- m.hideOption = "Black d'hide";
- m.hideUsed = "Black dragonhide";
- m.hideCreated = "Black dragon leather";
- m.hideUsedPaintName = "Black Dragonhide";
- m.hidePaintName = "Black Dragon Leather";
- m.hideIdSelling = 2509;
- m.hideIdRaw = 1747;
- m.tanningCost = 20;
- m.buyAbove = 200;
- }
- if (chckbxAutoGE.isSelected()) {
- m.autoGE = true;
- }
- if (!chckbxAutoGE.isSelected()) {
- m.autoGE = false;
- }
- if (chckbxEnableMule.isSelected()) {
- m.muleEnabled = true;
- }
- if (!chckbxEnableMule.isSelected()) {
- m.muleEnabled = false;
- }
- m.start = true;
- jFrame.setVisible(false);
- });
- }
- public boolean isShowing(JFrame window) {
- if (window.isShowing()) {
- return true;
- } else {
- return false;
- }
- }
- }
- // ** add: GUI.Window(this); in the main class in the method: onStart
Advertisement
Add Comment
Please, Sign In to add comment