Results 1 to 3 of 3
  1. #1
    paulb is offline Member
    Join Date
    Nov 2009
    Rep Power

    Default BoxLayout problems

    I am having problems with a gui that I am writing. The gui has a dialog box which has a couple of jpanels. One panel has a its layout set to boxlayout and is set to Y_AXIS(top to bottom). The panel contains a JLabel and a JTextArea. There are 4 of these(JLabel and JTextArea components) in the panel.

    When I run the code the labels are not aligned to the left. The textarea is but not the labels! No matter what I do I cant align them to the left.

    Can someone please tell me what I doing wrong?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

  3. #3
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Rep Power


    Read the section from the Swing tutorial on "How to Use BoxLayouts". It goes into detail explaining how alignments works and has examples to demonstrate the behaviour.

Similar Threads

  1. BoxLayout Behaviour
    By PetalumaBoy in forum AWT / Swing
    Replies: 4
    Last Post: 06-10-2009, 01:27 PM
  2. Replies: 7
    Last Post: 05-22-2009, 03:57 AM
  3. Replies: 4
    Last Post: 02-16-2009, 10:52 PM
  4. GUI problems.
    By saytri in forum New To Java
    Replies: 1
    Last Post: 12-16-2007, 11:27 PM
  5. gui problems
    By bluebirdjc in forum Advanced Java
    Replies: 2
    Last Post: 07-23-2007, 05:38 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