File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 41599
    
  55
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...