Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Card layout...

 
Andy Powell
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I'm having problems using cardlayout, I am trying to make a GUI for a pretend bike shop where you can build your own bikes.
I thought it would be a good idea to have separate panels so that once one step has been done, it moves to the next panel.

I haven't added all my components onto each panel yet but as a test I just wanted to see if I could get it to swap to the next one.



I am starting it with this...


The Problem that I'm having is that well, basically it doesn't do anything.
Both classes compile fine but when I come to run it, it executes, nothing happens and then it finishes.
I just don't get anything.

Can anyone tell me where I'm going wrong, its probably really simple.

Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JPanel is not something that can be displayed directly - only dialogs or frames can. Have the GUIness class extend JFrame instead of JPanel.
 
Andy Powell
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aaah, thank you very much. I knew that as well! My stupidity coming out in full force today.

Thanks again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic