Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Multiple, overlapping JPanels?  (Read 1084 times)
0 Members and 1 Guest are viewing this topic.
Offline pragun

JGO n00b
*

Posts: 8



« on: 2006-02-11 22:04:35 »

Hey guys, my game is currently set up so that there is a single JFrame. The "Game" class displays levels, etc (extends JPanel).
However, I now need to make a screen for the level select/ menus. Is there a way to make more JPanels and have them overlap each other on the JFrame, and then just pick which one to show (and subsequently hide others), so I don't have to use a GameState variable or something and end up with a 100kb Game.class instead.
Thanks, much appreciated.
Offline Jeff

JGO Kernel
*****

Posts: 3535


Got any cats?


« Reply #1 on: 2006-02-11 22:13:00 »

Its called a TabbedPane

RTJD

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline pragun

JGO n00b
*

Posts: 8



« Reply #2 on: 2006-02-12 00:06:50 »

I thought about TabbedPanes but can you hide their buttons?
Games published by our own members! Go get 'em!
Offline HamsterofDeath

Jr. Member
**

Posts: 75


Java games rock!


« Reply #3 on: 2006-02-12 05:28:03 »

you are looking for the cardlayout.
Offline cylab

JGO Kernel
*****

Posts: 1940
Medals: 27



« Reply #4 on: 2006-02-12 06:40:24 »

How to Use Cardlayout

Mathias - I Know What [you] Did Last Summer!
Offline pragun

JGO n00b
*

Posts: 8



« Reply #5 on: 2006-02-12 22:03:48 »

CardLayout has worked great!
Thanks a bunch, guys.  Grin
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.108 seconds with 20 queries.