JPanel colors don't show
I have written a very simple gui, which I am going to use to build upon. I don't see a problem with my code except that when I run it the colors don't appear. What am I doing wrong? This is my code:
JFrame frame = new JFrame();
JPanel tophalf = new JPanel();
JPanel bottomhalf = new JPanel();
frame.getContentPane() .add(BorderLayout.NORTH, tophalf);
frame.getContentPane() .add(BorderLayout.SOUTH, bottomhalf);
Try not setting it visible until it is ready to be seen.