Could someone advise me on the best Layout for 2 JLabels inside a JPanel. The Labels should always be side by side, instead of one on top of the other, and stuck at opposite ends of the JPanel, but in the case of the one on the right, it should not shift when text in it is changed. Thanks so much for your help.
From the top of my mind, BoxLayout would be good for this. You can add a label, then add some glue, and add your second label. The glue will take up the extra space. Take a look at Box.createHorizontalGlue().
The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.