Java frames

Discussion in 'Java' started by Big - Goofy, Jan 25, 2007.

  1. Big - Goofy

    Big - Goofy Guest

    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.
    Big - Goofy, Jan 25, 2007
    #1
    1. Advertising

  2. On Jan 25, 1:23 pm, Big - Goofy <> 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, Jan 25, 2007
    #2
    1. Advertising

  3. Big - Goofy

    Big - Goofy Guest

    Thanks for your reply . everything is in Swing JFrame JMenuBar
    JInternalFrame !

    Thanks

    On 24 Jan 2007 19:05:29 -0800, "Andrew Thompson"
    <> wrote:

    >On Jan 25, 1:23 pm, Big - Goofy <> 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, Jan 25, 2007
    #3
  4. On Jan 25, 9:05 pm, Big - Goofy <> 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 <> 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.
    Andrew Thompson, Jan 25, 2007
    #4
  5. Big - Goofy

    Big - Goofy Guest

    On 25 Jan 2007 02:40:37 -0800, "Andrew Thompson"
    <> wrote:

    >On Jan 25, 9:05 pm, Big - Goofy <> 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 <> 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.
    Big - Goofy, Jan 25, 2007
    #5
  6. Big - Goofy

    Oliver Wong Guest

    "Big - Goofy" <> wrote in message
    news:p...
    > 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/tutorial/uiswing/layout/card.html

    - Oliver
    Oliver Wong, Jan 25, 2007
    #6
  7. Big - Goofy

    Big - Goofy Guest

    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 <>
    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.
    Big - Goofy, Jan 28, 2007
    #7
  8. Big - Goofy

    Oliver Wong Guest

    "Big - Goofy" <> wrote in message
    news:...
    > 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
    Oliver Wong, Jan 29, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Powerslave2112

    From Frames to no frames?

    Powerslave2112, Jan 20, 2004, in forum: HTML
    Replies:
    2
    Views:
    566
    brucie
    Jan 20, 2004
  2. Philip
    Replies:
    3
    Views:
    944
    Karl Groves
    Jun 28, 2004
  3. Ale

    Frames or not Frames...

    Ale, Aug 3, 2005, in forum: HTML
    Replies:
    17
    Views:
    936
    Adrienne
    Aug 5, 2005
  4. Replies:
    1
    Views:
    985
    dorayme
    Feb 10, 2006
  5. Replies:
    0
    Views:
    1,187
Loading...

Share This Page