Guest User

Untitled

a guest
Apr 26th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. import java.awt.Container;
  2. import java.awt.FlowLayout;
  3. import java.awt.GridLayout;
  4. import java.awt.event.ActionEvent;
  5. import java.awt.event.ActionListener;
  6.  
  7. import javax.swing.GroupLayout;
  8. import javax.swing.JButton;
  9. import javax.swing.JFrame;
  10. import javax.swing.JLabel;
  11. import javax.swing.JList;
  12. import javax.swing.JScrollPane;
  13. import javax.swing.JTextArea;
  14. import javax.swing.JTextField;
  15. import javax.swing.JTextPane;
  16.  
  17. public class GUI extends JFrame implements ActionListener {
  18.  
  19. private static final long serialVersionUID = 1L;
  20. private static final int FRAME_WIDTH = 900;
  21. private static final int FRAME_HEIGHT = 700;
  22. private JTextArea menu;
  23. private JTextArea search;
  24. private ItemButton buttonA;
  25. private ItemButton buttonB;
  26. private ItemButton buttonC;
  27. private ItemButton buttonD;
  28. private ItemButton buttonE;
  29. private ItemButton buttonF;
  30. private ItemButton button1;
  31. private ItemButton button2;
  32. private ItemButton button3;
  33. private ItemButton button4;
  34. private ItemButton button5;
  35. private ItemButton button6;
  36. private JButton getChange;
  37. private JButton addMoney;
  38. private JButton vend;
  39. private JScrollPane scrollBar = new JScrollPane(menu);
  40. private JTextPane searchResults;
  41. private JLabel itemSelection;
  42. private JLabel makeASelection;
  43. private JLabel moneyRemaining;
  44.  
  45. public GUI() {
  46. this.setSize(FRAME_WIDTH, FRAME_HEIGHT);
  47. this.setVisible(true);
  48. Container container = new Container();
  49. container.setVisible(true);
  50. this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  51. this.add(container);
  52.  
  53. menu = new JTextArea("Hi there");
  54. search = new JTextArea("Hello");
  55. buttonA = new ItemButton("A");
  56. buttonB = new ItemButton("B");
  57. buttonC = new ItemButton("C");
  58. buttonD = new ItemButton("D");
  59. buttonE = new ItemButton("E");
  60. buttonF = new ItemButton("F");
  61.  
  62. container.add(search);
  63. container.add(menu);
  64. container.add(buttonA);
  65. container.add(buttonB);
  66. container.add(buttonC);
  67. container.add(buttonD);
  68. container.add(buttonE);
  69. container.add(buttonF);
  70.  
  71. GroupLayout layout = new GroupLayout(container);
  72. container.setLayout(layout);
  73.  
  74.  
  75. search.setEditable(false);
  76. }
  77.  
  78. public static void main(String[] args) {
  79. GUI gui = new GUI();
  80. }
  81.  
  82. public void actionPerformed(ActionEvent arg0) {
  83. // TODO Auto-generated method stub
  84.  
  85. }
  86.  
  87. }
Add Comment
Please, Sign In to add comment