Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.07 seconds.

  1. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    An SSCCE should be something you can copy and paste into (and out of) the forums. A lot of people (myself included) are accessing the site from work or school, so they might be behind a firewall that...
  2. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    If you post an SSCCE, I'll play around with it. The code you posted contains classes that I don't have, which might be irrelevant to the problem anyway.
  3. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    Hmm I'm not sure without seeing the SSCCE. You could try calling requestFocusInWindow() on the JPanel in question. Does it work without the CardLayout, if you just add it to another JPanel directly?...
  4. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    Ah, sorry if I didn't post it before, but it's the first result for googling "Java CardLayout": How to Use CardLayout (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components...
  5. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    JPanel cards are shown by Strings. Each JPanel has to have a unique String identifier (that can be "panel1", "panel2", or "startPanel", "gamePanel", etc, whatever you want). I'm not sure what you're...
  6. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    The code you have seems to add it just fine. What isn't working, exactly?




    What happened when you tried both?
  7. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    I don't know what your Room Objects are, so I can't really help you. But the general idea is that you'd have one main class that sets up the CardLayout, and from there you'd instantiate whatever...
  8. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    That's what the OP is asking how to do. The answer is to use CardLayout.
  9. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    Or you can have CardLayout do that for you.
  10. Replies
    23
    Views
    2,346

    Re: Changing from a screen to another!

    Sounds like a job for CardLayout!
Results 1 to 10 of 10