Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package wall_safer;
- import java.awt.BorderLayout;
- import java.awt.EventQueue;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.border.EmptyBorder;
- import java.awt.Toolkit;
- import javax.swing.JCheckBoxMenuItem;
- import javax.swing.JLabel;
- import javax.swing.JComboBox;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JMenu;
- import javax.swing.JMenuBar;
- import javax.swing.JMenuItem;
- import javax.swing.JSpinner;
- import javax.swing.SpinnerNumberModel;
- import javax.swing.JSlider;
- import java.awt.event.ActionListener;
- import java.awt.event.ActionEvent;
- public class Gui extends JFrame {
- public static boolean scopeboolean = false;
- public static boolean worldboolean = false;
- public static int hp;
- public static int foodamount;
- public static String food;
- private JPanel contentPane;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- Gui frame = new Gui();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the frame.
- */
- public Gui() {
- setIconImage(Toolkit.getDefaultToolkit().getImage(
- "C:\\Users\\MY-PC\\Desktop\\abs.jpg"));
- setTitle(" Wall Safer");
- setAlwaysOnTop(true);
- setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- setBounds(100, 100, 249, 231);
- JMenuBar menuBar = new JMenuBar();
- setJMenuBar(menuBar);
- contentPane = new JPanel();
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- contentPane.setLayout(null);
- JLabel lblFoodType = new JLabel("Food Type");
- lblFoodType.setBounds(30, 25, 62, 14);
- contentPane.add(lblFoodType);
- final JComboBox comboBox = new JComboBox();
- comboBox.setModel(new DefaultComboBoxModel(new String[] { "Trout",
- "Salmon", "Tuna", "Lobster", "Swordfish", "Monkfish", "Curry",
- "Shark" }));
- comboBox.setBounds(10, 39, 100, 22);
- contentPane.add(comboBox);
- JLabel lblWithdrawAmount = new JLabel("Withdraw Amount");
- lblWithdrawAmount.setBounds(116, 25, 115, 14);
- contentPane.add(lblWithdrawAmount);
- //the food amount
- final JSpinner spinner = new JSpinner();
- spinner.setModel(new SpinnerNumberModel(1, 1, 28, 3));
- spinner.setBounds(135, 41, 36, 18);
- contentPane.add(spinner);
- // the hp bar
- final JSlider slider = new JSlider();
- slider.setValue(35);
- slider.setPaintTicks(true);
- slider.setPaintLabels(true);
- slider.setMinorTickSpacing(5);
- slider.setMajorTickSpacing(10);
- slider.setBounds(10, 132, 210, 40);
- contentPane.add(slider);
- JLabel lblHitPoints = new JLabel("Hit Points");
- lblHitPoints.setBounds(100, 107, 71, 14);
- contentPane.add(lblHitPoints);
- JMenu menu = new JMenu("Settings");
- menuBar.add(menu);
- JMenuItem start = new JMenuItem("Start");
- menu.add(start);
- start.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- setData();
- dispose();
- }
- private void setData() {
- hp = slider.getValue();
- foodamount = (Integer) spinner.getValue();
- food = comboBox.getSelectedItem().toString();
- }
- });
- final JCheckBoxMenuItem scope = new JCheckBoxMenuItem("Scope");
- scope.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- scopeboolean = true;
- }
- });
- menu.add(scope);
- JCheckBoxMenuItem worldhopping = new JCheckBoxMenuItem("World Hopping");
- worldhopping.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- worldboolean = true;
- }
- });
- menu.add(worldhopping);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment