Re: JInternalFrame and JMenuBar
On Jan 29, 11:14 pm, Big - Goofy <vada...@hotmail.com> wrote:
Please refrain from top-posting. I find it most confusing.
..How can I implement the tabbedPane in my game?
Add the JTabbedPane (JTP) in place of the JDesktopPane.
The Java tutorial has a section devoted to JTP's..
<http://java.sun.com/docs/books/tutorial/uiswing/components/
tabbedpane.html>
Also handy is the opening paragraphs in the
JavaDocs for the JTP.
Note that when I initially suggested a JTP, I
was thinking it would be best if the game needed
to open any number of instances of the game
playing area. If it does *not* make sense to
have a number of game play areas open at
one time, it might be better to use a CardLayout
or add the game (in a JPanel - would be best)
directly to the content pane.
The question you need to anwser with the
second approach is, what do you do if the
user wants to play '10 games in a row - one
after the other'?
One way is to add a new game each time
to a CardLayout (or JTP - though that makes
less sense to the user), or alternately to entirely
remove the cureent game compoenent, and
add a new one, or the strategy I would probably
take, to devise a 'reset()' method for the game
play area that takes it back to the initial state
(ready for a new game).
Andrew T.