|
-
January 20th, 2011, 07:01 PM
#3
Re: displaying alternate jpanels in a jframe
I don't think you can add a JFrame into another JFrame as a JFrame is a top level container. You should be able to add as many JPanels to a JFrame as you like though. Can I assume that Attack() and Defend have something to do with JPanels? If each are a special instance of JPanel then perhaps you could create one instance of each JPanel and add them both to the JFrame then toggle the visibility of each to simulate a different frame when you have an "Attack" action and a "Defend" action. Than way you don't have to recreate a new JPanel each time.
By the way any program with Attack() and Defend() methods is, by default, rad. Just so you know. =D
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|