I am working on a program for my school to use. It is like match.com, but for a public school. Yes there has been permission from the school to do this.
This is the first time I have ever used swing and I am having an issue with adding my JPanel to my JFrame so that I can see and use the button.
private void Framing()
{
JPanel Panel = new JPanel();
Panel.setLayout(new BorderLayout());
JFrame Frame = new JFrame("Warning");
Frame.setUndecorated(true);
JButton OK = new JButton("EXIT");
OK.addActionListener((ActionEvent event) -> {System.exit(0);});
OK.setBounds(100,100,100,100);
Panel.add(OK, BorderLayout.CENTER);
Frame.getContentPane().add(Panel, BorderLayout.CENTER);
Panel.setLocation((Frame.getWidth()-Panel.getWidth())/2,0);
Frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
Frame.setLocation(600, 300);
Frame.setResizable(false);
Frame.setLayout(null);
Frame.setVisible(true);
}
What is the fastest way to fix the issue with the panel not even showing up? Any solutions are welcomed.