Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.09 seconds.

  1. Replies
    9
    Views
    3,024

    Re: Adding a Panel from a different class

    Out of curiosity, what did you try?
  2. Replies
    9
    Views
    3,024

    Re: Adding a Panel from a different class

    If you want the JPanel to appear and disappear, then just set its visibility via the menu. If you want different JPanels to be in the same location at different times, then you want CardLayout....
  3. Replies
    9
    Views
    3,024

    Re: Adding a Panel from a different class

    Well yeah, the other half is to actually add it to the JFrame- which, if I'm understanding your question right, is where CardLayout comes into play.
  4. Replies
    9
    Views
    3,024

    Re: Adding a Panel from a different class

    I guess I'm just confused by what's stopping you. Just add a getter or a setter to pass the JPanel, then add it wherever you want.
  5. Replies
    9
    Views
    3,024

    Re: Adding a Panel from a different class

    I'm not really sure what your question is, but if you want to pass a reference between classes, simply call a getter or a setter with that JPanel.

    It sounds like CardLayout might be your friend...
Results 1 to 5 of 5