I would take that code out of the constructor and put it in its own method. I would then create a method for the Menu Bar and a method for the Status Bar. I would place each onto its on JPanel using whatever layout you find appropiate. I would then add each panel to the content pane using whatever layout you need to get them how you want, maybe BorderLayout. You dont need to worry about a layout being null. If you want the layout of your MenuBar to be a GridLayout, do somthing like
CODE
private void menuBarPanel() {
JPanel menuPanel = new JPanel();
menuPanel .setLayout(new FlowLayout());
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu("My Menu");
menu.setMnemonic(KeyEvent.VK_A);
menu.getAccessibleContext().setAccessibleDescription("My Items");
menuBar.add(menu);
//add your items to the menu
menuPanel.add(menuBar, 0);
}
}
Do this for the other Panels too. Then you can create a mainPanel, like your content pane, and add your three panels to it
CODE
private void mainPanel(){
JComponent mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout(5, 5));
mainPanel.add(menuPanel, BorderLayout.NORTH);
//then other panels
add(mainPanel);
}
Initialise all your Panels in the constructor, so that they are created
CODE
public PlayerField()
{
setTitle("Player Field");
setSize(300, 300);
setDefaultCloseOperation(EXIT_ON_CLOSE);
menuBarPanel();
//other panels
mainPanel();
}
Then you should be good to go. Need any advise just ask