Results 1 to 2 of 2
  1. #1
    willemien is offline Member
    Join Date
    Apr 2010
    Location
    london UK
    Posts
    53
    Rep Power
    0

    Default Making a gui with Swing

    I would like to make a Gui that can change the way it looks like below

    all panels visuable:


    Java Code:
    ++============++================+==========+
    || main Panel || panel2         | panel 3  |
    || always     ||                |          |  
    || visuable   ||                |          |  
    +=============++                |          |
    || panel 1    ||                |          | 
    ||            ||                |          | 
    ||            ||                |          | 
    ++============++----------------+----------+
    || panel 5                                ||
    ||                                        ||
    ++-----------------------------------------+




    All panels except the main panel can be removed/ closed

    the main panel has fixed dimensions and has a number of buttons that open or close the other panels.(each independend of any other)

    panel 1 also has fixed dimensions (or in fact only a fixed height, the width is just the with from the main panel)
    panel 2 and 3 have a fixed width
    panel 5 has a fixed height

    panels 1,2,3,4,and 5 ech contain a different scrollpanes

    the height of panel 2 and 3 depends on if panel 1 is available if panel 1 is visuable then as above if panel 1 is closed it should look like



    Java Code:
    ++============++================+==========+
    || main Panel || panel2         | panel 3  |
    || always     ||                |          |  
    || visuable   ||                |          |
    ++============++----------------+----------+
    || panel 5                                ||
    ||                                        ||
    ++-----------------------------------------+

    The with of panel 5 depends on if panel 2 and 3 are available

    (each can be closed independent of the other

    so with mainpanel (always visuable) and panel 1 and 3 and 5 it should look like





    Java Code:
    ++============++==========+
    || main Panel || panel 3  |
    || always     ||          |  
    || visuable   ||          |  
    +=============++          |
    || panel 1    ||          | 
    ||            ||          | 
    ||            ||          | 
    ++============++----------+
    || panel 5               ||
    ||                       ||
    ++------------------------+


    and so on

    How can I do this?

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default Re: Making a gui with Swing

    Read the API documentation for the BorderLayout layout manager; you can put panels in them and those panels can have their own layout managers which can have other panels in them etc. Your layout resembles a BorderLayout where the part in the 'west' seems to contain a nested layout manager.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Need help making a GUI
    By DrKilljoy in forum New To Java
    Replies: 21
    Last Post: 07-15-2010, 03:44 AM
  2. Swing question: Making a visual tic tac toe
    By alacn in forum New To Java
    Replies: 8
    Last Post: 07-05-2010, 02:42 AM
  3. making a monogram swing
    By moostico246 in forum AWT / Swing
    Replies: 29
    Last Post: 04-07-2009, 04:08 AM
  4. code for making a java swing program a demo verson
    By fakhruddin in forum AWT / Swing
    Replies: 1
    Last Post: 11-27-2007, 08:54 PM
  5. Making a session in swing
    By sandor in forum AWT / Swing
    Replies: 3
    Last Post: 04-22-2007, 10:58 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
  •