Forums Register Login

BoxLayout alignment

+Pie Number of slices to send: Send
I have a JPanel with vertical BoxLayout.
I have added 3 JRadioButtons

When I setAlignmentX(Component.LEFT_ALIGNMENT) their left sides are lined up, but they go to the right of the panel.
When I setAlignmentX(Component.RIGHT_ALIGNMENT) their right sides are in line, but they are on the left of the panel.

How can I get them on the left of the panel, with their left sides in line?

By the way there are lots of other things in the panel as well, comboboxes and other panels (spread to fill), lists (centered) ...

---Liz
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 754 times.
Similar Threads
Help sorting out what combination of layouts will provide the result I need
HeadFirst BeatBox: Getting the buttons to be aligned center
BoxLayout not working as advertised?
using JLabel to title a JScroller
Swing component alignment
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:58:04.