Jump to content

Gui Help


scriptersteve

Recommended Posts

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;
    }
    */
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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