posted 23 years ago
Hey,
I have a JFrame that is 800 X 600. Ok in this JFrame i have a JMenuBar. On the JMenuBar i have a Menu called modes. In this i have two modes one is a runmode and the other will allow the user to build so it is a build mode. My problem is creating these JPanels in the JFrame. But, i don't want them to be on at the same time. Say if one is clicked the other will go away but no lose any data and the other will appear. These JPanels will be about 500X500. I can't get it to show up. I do have the buildmode as a class and the same as the runmode. I really need help if anyone can help me. PLEASE!!! Some sample code could get me going this is what i have so far. I know there are problems please help. I can't get anything. I also have the actionPerformed ready to go with no code in it so that it will go to different frames. Oh yea, there should be a main because the objects on the main screen needs to stay because the diffent thing about the build mode it that it draws a grid where you place objects but it will have some buttons too. Please help thanks
private JPanel buildmode, runmode;
private Dimension bmDim;
private Dimension rmDim;
public GizmoBallGUI() {
initComponents();
setTitle("GizmoBall");
setSize(WIDTH, HEIGHT);
Container contentPane = getContentPane();
buildmode = new JPanel();
buildmode.setLayout(new BorderLayout());
buildmode.setBackground(Color.white);
contentPane.add(buildmode);
bmDim = new Dimension();
bmDim.setSize(500, 500);
buildmode.add(BorderLayout.CENTER, bmDim);