This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Card layout... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Card layout..." Watch "Card layout..." New topic
Author

Card layout...

Andy Powell
Greenhorn

Joined: Apr 18, 2010
Posts: 20
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
Marshal

Joined: Mar 22, 2005
Posts: 41150
    
  45
A JPanel is not something that can be displayed directly - only dialogs or frames can. Have the GUIness class extend JFrame instead of JPanel.


Ping & DNS - my free Android networking tools app
Andy Powell
Greenhorn

Joined: Apr 18, 2010
Posts: 20
aaah, thank you very much. I knew that as well! My stupidity coming out in full force today.

Thanks again
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Card layout...
 
Similar Threads
running gifs
Switching between the frames
panel and image problem
Global array is null after its been filled
BorderLayout JLabel size problem