Results 1 to 9 of 9
  1. #1
    yankeetooter7 is offline student
    Join Date
    Jun 2012
    Location
    MD
    Posts
    8
    Rep Power
    0

    Default panels, panels, and more panels

    Hey all:

    How do you put a panel (or panels) within another panel?

    yankeetooter7

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,891
    Rep Power
    25

    Default Re: panels, panels, and more panels

    You use the add() method to add components to containers.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: panels, panels, and more panels

    Are you talking about JPanel?

    If so, use the add() method. There's a discussion panels in Oracle's Tutorial.

    (Moved to the AWT/Swing forum)

  4. #4
    yankeetooter7 is offline student
    Join Date
    Jun 2012
    Location
    MD
    Posts
    8
    Rep Power
    0

    Default Re: panels, panels, and more panels

    Thanks for the link...

    yankeetooter7

  5. #5
    yankeetooter7 is offline student
    Join Date
    Jun 2012
    Location
    MD
    Posts
    8
    Rep Power
    0

    Default Re: panels, panels, and more panels

    Yes, but I am having trouble figuring out where I add the panels...in the driver class, in the constructor...*shrugs*. I think I am giving up for the night...too tired.

  6. #6
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: panels, panels, and more panels

    You're welcome.

    Depending on your experience the API docs can be as clear as mud... Oracle's Tutorial is a very valuable resource but, again, the page I linked to doesn't have a lot of overall "context" so you might have to look around the surrounding pages.

    One common mistake is to overlook the importance of panel layouts. In Java (or rather awt/swing) panels and layouts are pretty much a package detail. So a more accurate answer to your quesion would be: set the layout, then add(). Getting the hang of which layout to use and when involves some tinkering.

    If you get stuck, post what you've come up with and describe what goes wrong.

  7. #7
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: panels, panels, and more panels

    Probably the panel's constructor. But, sans code, that's a guess.

    Read the links and sleep on it. Between the muses and some playing about with code as they might suggest you'll come up with something. Then it's just amatter of making it work...

  8. #8
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: panels, panels, and more panels

    Probably the panel's constructor. But, sans code, that's a guess.

    Read the links and sleep on it. Between the muses and some playing about with code as they might suggest you'll come up with something. Then it's just amatter of making it work...

  9. #9
    yankeetooter7 is offline student
    Join Date
    Jun 2012
    Location
    MD
    Posts
    8
    Rep Power
    0

Similar Threads

  1. Frame with 2 Panels
    By collwill in forum New To Java
    Replies: 9
    Last Post: 01-10-2013, 07:49 AM
  2. Gap Between Panels?
    By OllyHal in forum AWT / Swing
    Replies: 1
    Last Post: 03-13-2012, 09:36 PM
  3. frames and panels
    By alextemari in forum New To Java
    Replies: 6
    Last Post: 03-26-2011, 05:01 AM
  4. Need some help with panels inside panels
    By kakefjes in forum AWT / Swing
    Replies: 0
    Last Post: 03-17-2011, 12:36 PM
  5. Java Panels
    By nikkka in forum New To Java
    Replies: 11
    Last Post: 03-12-2011, 03:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •