gridBagLayout anchor ... wanna move all components to top left
I have a panel and in that panel I have 3 labels. This is obviously just test code which will become more complicated but the idea is to have a panel of a certain width and then add labels within that panel such that they are top-left/WEST aligned. The sample code is attached with this message and if you run it you will see that java renders all components center aligned which is a massive pain.
I have tried changing the x-weights of labels and it does tend to work very unpredictably. Another thing I have done is to add an empty spacer label right at the end of the row with large width and high x-weighting which tends to push all others to the left. But it does not seem like an elegant solution. Especailly considering that I will have a large number of rows in the app I am working on.
ps: I cant use swing unfortunately... I am working on a legacy app.
thanks in advance :)