private TicketMachine machine; private JLabel statusLabel; private JButton printbutton; private JTextField insert; /** * Constructor for objects of class TicketMachinePanel */ public TicketMachinePanel(TicketMachine machine) { this.machine = machine; setPreferredSize(new Dimension(600, 600)); setLayout(new BorderLayout()); insert = new JTextField(); statusLabel = new JLabel("Welcome! Insert money to begin. (Press ENTER after input)"); printbutton = new JButton("Print your ticket to Console!"); add(statusLabel, BorderLayout.SOUTH); add(insert, BorderLayout.NORTH); add(printbutton, BorderLayout.CENTER);