Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import BreezySwing.*;
- @SuppressWarnings({ "unused", "serial", "restriction"}) //Shut up, Eclipse.
- public class GlucavaGUI extends GBFrame
- {
- //Make GUI objects.
- private JLabel titleLabel;
- private JLabel sugarLabel;
- private IntegerField sugarField;
- private JLabel timeLabel;
- private IntegerField timeField;
- private JLabel seperator;
- private JLabel foodLabel;
- private JTextField foodField;
- private JButton addFoodButton;
- private JLabel currentFoodLabel;
- private JTextArea currentFoodArea;
- private JButton calculateButton;
- //Constructor
- public GlucavaGUI ()
- {
- //GUI Positioning
- titleLabel = addLabel ("Welcome to Glucava", 1, 1, 5, 1);
- sugarLabel = addLabel ("Current Sugar", 2, 1, 2, 1);
- sugarField = addIntegerField (150, 2, 4, 2, 1);
- timeLabel = addLabel ("Time (24h)", 3, 1, 2, 1);
- timeField = addIntegerField (0000, 3, 4, 2, 1);
- seperator = addLabel ("", 4, 3, 5, 1);
- foodLabel = addLabel ("Food", 5, 2, 1, 1);
- foodField = addTextField ("", 6, 1, 5, 1);
- addFoodButton = addButton ("Add", 5, 4, 1, 1);
- currentFoodLabel = addLabel ("Current foods added:", 7, 1, 1, 1);
- currentFoodArea = addTextArea ("", 8, 1, 5, 3);
- calculateButton = addButton ("Calculate", 11, 1, 1, 1);
- }
- public void buttonClicked (JButton buttonObj)
- {
- GlucavaBackbone backbone = new GlucavaBackbone();
- if (buttonObj == addFoodButton)
- {
- //TODO Add food stuff.
- }
- else
- {
- //TODO Add calculate stuff.
- }
- }
- public static void main (String [] args)
- {
- GlucavaGUI theGUI = new GlucavaGUI();
- theGUI.setSize (330, 625);
- theGUI.setVisible (true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement