Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Java frames (http://www.velocityreviews.com/forums/t390340-java-frames.html)

Big - Goofy 01-25-2007 02:23 AM

Java frames
 
Hello ,

I have done a game (a scrabble game) and the way I did it is in two
frames! One for the menu and one for the game. SO when you click on
new Game then is opening another frame! The thing is that now I did a
menubar so I want to call somehow the frame of the game in the current
frame or otherwise I would like to do the same thing in an
InternalFrame .... I know that it is possible but nothing coming out
of my head at the momment.Please Help :)

Thanks a lot in advance.

Andrew Thompson 01-25-2007 03:05 AM

Re: Java frames
 
On Jan 25, 1:23 pm, Big - Goofy <vada...@hotmail.com> wrote:
...
> I have done a game (a scrabble game) and the way I did it is in two
> frames!


Do you mean java.awt.Frame, javax.swing.JFame,
<a href='thegame.hml' target='gameframe''>, or
something else?

>...One for the menu and one for the game. SO when you click on
> new Game then is opening another frame! The thing is that now I did a
> menubar ..


java.awt.MenuBar? javax.swing.JMenuBar?
<ul class='menubar'>
<li><a href='game.htm'>Game</a>
<li><a href='help.htm'>Help</a>
</ul> ?

>...so I want to call somehow the frame of the game in the current
> frame or otherwise I would like to do the same thing in an
> InternalFrame ..


<iframe>? javax.swing.JInternalFrame?

Andrew T.


Big - Goofy 01-25-2007 10:05 AM

Re: Java frames
 
Thanks for your reply . everything is in Swing JFrame JMenuBar
JInternalFrame !

Thanks

On 24 Jan 2007 19:05:29 -0800, "Andrew Thompson"
<andrewthommo@gmail.com> wrote:

>On Jan 25, 1:23 pm, Big - Goofy <vada...@hotmail.com> wrote:
>..
>> I have done a game (a scrabble game) and the way I did it is in two
>> frames!

>
>Do you mean java.awt.Frame, javax.swing.JFame,
><a href='thegame.hml' target='gameframe''>, or
>something else?
>
>>...One for the menu and one for the game. SO when you click on
>> new Game then is opening another frame! The thing is that now I did a
>> menubar ..

>
>java.awt.MenuBar? javax.swing.JMenuBar?
><ul class='menubar'>
> <li><a href='game.htm'>Game</a>
> <li><a href='help.htm'>Help</a>
></ul> ?
>
>>...so I want to call somehow the frame of the game in the current
>> frame or otherwise I would like to do the same thing in an
>> InternalFrame ..

>
><iframe>? javax.swing.JInternalFrame?
>
>Andrew T.


Andrew Thompson 01-25-2007 10:40 AM

Re: Java frames
 
On Jan 25, 9:05 pm, Big - Goofy <vada...@hotmail.com> wrote:
> Thanks for your reply .


Your future lack of top-posting, will be thanks enough.
(rest of top-post corrected).

> On 24 Jan 2007 19:05:29 -0800, "Andrew Thompson"
> >On Jan 25, 1:23 pm, Big - Goofy <vada...@hotmail.com> wrote:
> >..
> >> I have done a game (a scrabble game) and the way I did it is in two
> >> frames!

>
> >Do you mean java.awt.Frame, javax.swing.JFame,..


>...everything is in Swing JFrame JMenuBar
> JInternalFrame !
>

...
> >>...One for the menu and one for the game. SO when you click on
> >> new Game then is opening another frame! The thing is that now I did a
> >> menubar ..

....
> >>...so I want to call somehow the frame of the game in the current
> >> frame or otherwise I would like to do the same thing in an
> >> InternalFrame ..

...
OK. I am still a little confused as to why you have
two JFrame's at all.

Why not have..
- a single JFrame with a single JMenuBar and a
blank 'playfield' area below that.
- When the users selects New Game from the menu,
either add the game (coded in a JPanel) into the
'playfield' area, or clear it to a 'new game' (if it
is already there).

The JPanel for the game could be ..
- Added once to the JFrame, as it is created,
but left in a 'blank' state to start with.
- Added to a java.awt.CardLayout (which would
allow the user to have multiple games going at once,
once you figure a way to allow them to switch
between current games.
- Added to a JTabbedPane (much the same deal
as the CardLayout)

Andrew T.


Big - Goofy 01-25-2007 04:59 PM

Re: Java frames
 
On 25 Jan 2007 02:40:37 -0800, "Andrew Thompson"
<andrewthommo@gmail.com> wrote:

>On Jan 25, 9:05 pm, Big - Goofy <vada...@hotmail.com> wrote:
>> Thanks for your reply .

>
>Your future lack of top-posting, will be thanks enough.
>(rest of top-post corrected).
>
>> On 24 Jan 2007 19:05:29 -0800, "Andrew Thompson"
>> >On Jan 25, 1:23 pm, Big - Goofy <vada...@hotmail.com> wrote:
>> >..
>> >> I have done a game (a scrabble game) and the way I did it is in two
>> >> frames!

>>
>> >Do you mean java.awt.Frame, javax.swing.JFame,..

>
>>...everything is in Swing JFrame JMenuBar
>> JInternalFrame !
>>

>..
>> >>...One for the menu and one for the game. SO when you click on
>> >> new Game then is opening another frame! The thing is that now I did a
>> >> menubar ..

>...
>> >>...so I want to call somehow the frame of the game in the current
>> >> frame or otherwise I would like to do the same thing in an
>> >> InternalFrame ..

>..
>OK. I am still a little confused as to why you have
>two JFrame's at all.
>
>Why not have..
>- a single JFrame with a single JMenuBar and a
>blank 'playfield' area below that.
>- When the users selects New Game from the menu,
>either add the game (coded in a JPanel) into the
>'playfield' area, or clear it to a 'new game' (if it
>is already there).
>
>The JPanel for the game could be ..
>- Added once to the JFrame, as it is created,
>but left in a 'blank' state to start with.
>- Added to a java.awt.CardLayout (which would
>allow the user to have multiple games going at once,
>once you figure a way to allow them to switch
>between current games.
>- Added to a JTabbedPane (much the same deal
>as the CardLayout)
>
>Andrew T.


Thanks fro your reply!
The thing is that I have done too much work and I dont want to edit it
like this. I just want to find a way to load the frame from the one
class in the frame of the current class. So when I click on the menu
-> new game and choose the name of the players, the game makes a call
to the other class and it shows up a new frame! instead of that I
would like to load this new frame in the internal frame. In this way I
will have only one window and not two as before! One more thing for
you to know , is that I cannot load the game class from the beginning
coz first I need to give the number of the players , the names and the
playing order before load it.

Oliver Wong 01-25-2007 10:43 PM

Re: Java frames
 

"Big - Goofy" <vadam17@hotmail.com> wrote in message
news:pt4gr2lf2v53ng434vgrmk2h323gngkn90@4ax.com...
> Hello ,
>
> I have done a game (a scrabble game) and the way I did it is in two
> frames! One for the menu and one for the game. SO when you click on
> new Game then is opening another frame! The thing is that now I did a
> menubar so I want to call somehow the frame of the game in the current
> frame or otherwise I would like to do the same thing in an
> InternalFrame .... I know that it is possible but nothing coming out
> of my head at the momment.Please Help :)
>
> Thanks a lot in advance.


Try using a CardLayout:

http://java.sun.com/docs/books/tutor...yout/card.html

- Oliver



Big - Goofy 01-28-2007 08:33 PM

Re: Java frames
 
Thanks for the previous help.
Now I ve got a new proble. I have a JFrame and a JMenuBar at the top
from which I call the method New Game and the new Game opens in a new
JInternalFrame. Everything working perfect except from the menuBar.
Without the internalFrame I can see all the menuItems , with the
internalFrame I can see only the first menuItems coz the internal
frame overwrites the last ones.
What can i do to have the menuBar over the JInternalFrame??




On Thu, 25 Jan 2007 02:23:22 +0000, Big - Goofy <vadam17@hotmail.com>
wrote:

>Hello ,
>
>I have done a game (a scrabble game) and the way I did it is in two
>frames! One for the menu and one for the game. SO when you click on
>new Game then is opening another frame! The thing is that now I did a
>menubar so I want to call somehow the frame of the game in the current
>frame or otherwise I would like to do the same thing in an
>InternalFrame .... I know that it is possible but nothing coming out
>of my head at the momment.Please Help :)
>
>Thanks a lot in advance.


Oliver Wong 01-29-2007 06:30 PM

Re: Java frames
 

"Big - Goofy" <vadam17@hotmail.com> wrote in message
news:qs1qr21882pikuvfnjqilvnmkt8m3r52kg@4ax.com...
> Thanks for the previous help.
> Now I ve got a new proble. I have a JFrame and a JMenuBar at the top
> from which I call the method New Game and the new Game opens in a new
> JInternalFrame. Everything working perfect except from the menuBar.
> Without the internalFrame I can see all the menuItems , with the
> internalFrame I can see only the first menuItems coz the internal
> frame overwrites the last ones.
> What can i do to have the menuBar over the JInternalFrame??


Can you post an SSCCE demonstrating the problem?
http://mindprod.com/jgloss/sscce.html

- Oliver




All times are GMT. The time now is 10:38 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.