Results 1 to 3 of 3
  1. #1
    Rocketz is offline Member
    Join Date
    Feb 2011
    Posts
    10
    Rep Power
    0

    Default Need Swing Layout Advice

    I'm creating a Java app that is going to be used as a survey tool. I'm creating the user interface based on XML data. I'm thinking each question will have it's own panel and then I'd like to stack the panels on top of each other. Ideally I'd like scroll bar so I can keep the window size constant.

    Is there a way to do this in Swing and what LayoutManager would work best for this situation

    Thanks,
    Rocketz

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    You can swap JPanels with a CardLayout which sounds most intuitive to me. Otherwise you seem to be describing a GridLayout. Realize though that most GUI's that are more than the most simplistic will do best with nested JPanels, each using its own layout.

  3. #3
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    The cardlayout is a good approach, if you google java 21 days you can find example source code of a survey somewhere in the books pages

Similar Threads

  1. Swing Html Layout
    By Kiruthigadhandapani in forum AWT / Swing
    Replies: 1
    Last Post: 05-03-2011, 04:39 PM
  2. Replies: 13
    Last Post: 12-06-2010, 06:57 AM
  3. Replies: 1
    Last Post: 10-31-2010, 08:41 PM
  4. Swing layout is done wrong
    By Onra in forum New To Java
    Replies: 5
    Last Post: 10-08-2010, 05:36 AM
  5. Add Swing Layout.jar
    By anilkumar_vist in forum New To Java
    Replies: 0
    Last Post: 10-02-2010, 05:42 AM

Posting Permissions

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