I have had this problem with a few apps, but just worked my around them. But I kind of need a solution to the problem now. I have a JDialog and I am using a BoxLayout with Y Alignment. I am adding JLabel, JTextField, JLabel, JTextField.... I need the JLabels to align to the left so I am using setAlignmentX(Component.LEFT_ALIGNMENT) but it is not moving the labels. Can someone look at my code and see if they can see what I am not seeing? Thanks.
For your example, the best solution is to replace the BoxLayout with a new GridLayout( 0, 1 ). I think BoxLayout centers it's components, and I don't see a way to change this without extending the class. In this case the fix is easy, just use a 1 column GridLayout, otherwise you'd have to use GridBagLayout or something that lets you mess with the placement of individual components more.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.