Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Laying out components.

  1. #1
    Forum Squatter newbie's Avatar
    Join Date
    Nov 2010
    Location
    North Wales
    Posts
    660
    My Mood
    Stressed
    Thanks
    28
    Thanked 115 Times in 106 Posts
    Blog Entries
    1

    Default Laying out components.

    Hey there, I'm just making a fairly simple utility program to try and enhance my Java knowledge and I've become rather stuck while trying to design the actual GUI.

    Here is what I've got at the moment:
    TimetableImage.jpg

    But I can't seem to get the lower control panel to centre in the bottom half like the JTable is centred.
    What ever I seem to try, it always ends up fixed to the bottom of the JFrame.

    The JTable is its own JPanel, and so is the bottom half which consists of a JTextArea and 3 buttons.

    The JTable is added onto the JFrame using BorderLayout Center, and the control panel with BorderLayout South.
    Does anyone know how, or with what layout manager I could get a result that might match the following sketch?

    Possible.jpg

    Edit: For clearance, by centred, I mean have the JPanel within the actual JFrame and not stuck to the edges.
    Please use [highlight=Java]//code goes here...[/highlight] tags when posting your code


  2. #2
    Member
    Join Date
    Aug 2011
    Posts
    48
    My Mood
    Fine
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default Re: Laying out components.

    Does anyone know how, or with what layout manager I could get a result that might match the following sketch?a
    You can consider to use GridBagLayout

    immutable objects
    Last edited by ha.minh.nam; December 4th, 2011 at 06:29 PM.

Similar Threads

  1. how to position gui components
    By programmer1 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 11th, 2011, 12:45 PM
  2. [SOLVED] Add more components from JFrame Form
    By zecute in forum AWT / Java Swing
    Replies: 3
    Last Post: May 11th, 2011, 07:30 AM
  3. Interaction between components.
    By SyntheticD in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 9th, 2011, 06:32 PM
  4. Getting Size of Components
    By aussiemcgr in forum AWT / Java Swing
    Replies: 3
    Last Post: July 26th, 2010, 03:41 PM
  5. [SOLVED] "GridLayout" problem in Java program
    By antitru5t in forum AWT / Java Swing
    Replies: 3
    Last Post: April 16th, 2009, 10:26 AM