Jump to content

Gui Help


Recommended Posts

Posted

Hi, I am very stuck on how to implement a GUI, any help would be greatly appreciated.

All the GUI needs to be is very simple: Take in armour type, food type and token value.

Then pass this into the original java file above.

I however, have no idea what i'm doing.  Below is my attempt, i'd be really grateful if someone would be able to have a look and fix it or atleast point me in the right direction.

Many thanks

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTextField;
public class GuiSetup {
    private final JFrame jFrame;

    /*
    private JLabel armourType;
    private JLabel foodLabel;
    private JLabel tokenAmount;
    private JTextField foodName;
    private JTextField tokenName;
    private JTextField TokenAmount;
    */



         public GuiSetup() {
        jFrame = new JFrame("WarriorGuild Tokens");
        JPanel mainPanel = new JPanel();
        JLabel armourType;
        JLabel foodLabel;
        JLabel tokenAmounta;
        JTextField food;
        JTextField armourName;
        JTextField tokenAmount;

    }
/*
    public static String getFoodName()
    {
        return foodName;
    }

    public static String getArmourName()
    {
        return armourName;
    }

    public static String getTokenAmount()
    {
        return tokenAmount;
    }
    */
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...