I have been trying to figure out why when I execute this code all I get is a little bar at the top of the screen without any of my Labels or Buttons please help with a debug
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.*;
public class inventFrame extends JFrame
{
public void BankingGUIFrame()
{
setTitle("Teller Program");
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension d = tk.getScreenSize();
int height = 200;
int width = 267;
setBounds((d.width-width)/2, (d.height-height)/2, width, height);
setResizable(true);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
Container contentPane = getContentPane();
JPanel panel = new BankingGUIPanel();
contentPane.add(panel);
}
public static void main(
String[] args)
{
JFrame frame = new inventFrame();
frame.show();
}
}
class BankingGUIPanel extends JPanel implements ActionListener
{
private JTextField custNumTF, custNameFTF, custNameMITF, custNameLTF;
private JLabel custNumL, custNameFL, custNameMIL, custNameLL;
private JButton exitButton;
public BankingGUIPanel()
{
JPanel displayPanel = new JPanel();
displayPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
custNumL = new JLabel("Customer Number: ");
custNameFL = new JLabel("First Name: ");
custNameMIL = new JLabel("Middle Inital: ");
custNameLL = new JLabel("Last Name: ");
custNumTF = new JTextField(10);
custNameFTF = new JTextField(10);
custNameMITF = new JTextField(10);
custNameLTF = new JTextField(10);
displayPanel.add(custNumL);
displayPanel.add(custNumTF);
displayPanel.add(custNameFL);
displayPanel.add(custNameFTF);
displayPanel.add(custNameMIL);
displayPanel.add(custNameMITF);
displayPanel.add(custNameLL);
displayPanel.add(custNameLTF);
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
exitButton = new JButton("Exit");
buttonPanel.add(exitButton);
exitButton.addActionListener(this);
setLayout(new BorderLayout());
add(displayPanel, BorderLayout.CENTER);
add(buttonPanel, BorderLayout.SOUTH);
}
public void actionPerformed(ActionEvent e)
{
Object source = e.getSource();
if (source == exitButton)
System.exit(0);
}
}