I want to increase the height of a custom JPanel
in a JFrame
. I tried to use pa.setSize(700,200)
but it does not change anything.
Here is the code:
JFrame f = new JFrame("Hello");
f.setResizable(true);
JPanel pa = new JPanel();
JButton btn = new JButton("Exit");
pa.setBackground(Color.red);
pa.setSize(700, 200);
f.setUndecorated(true);
f.getContentPane().add(pa, BorderLayout.NORTH);
f.setSize(new Dimension(700,700));
f.setLocation(500, 500);
f.setVisible(true);