Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

GUI building help please!!!!!  RSS feed

m dawg
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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() {
Container contentPane = getContentPane();
buildmode = new JPanel();
buildmode.setLayout(new BorderLayout());
bmDim = new Dimension();
bmDim.setSize(500, 500);
buildmode.add(BorderLayout.CENTER, bmDim);
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already answered this in the Swing/Awt forum. Please do not cross post in multiple forums.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!