Hey I’m attempting to align all panels within a panel to the left of the larger panel.
here is a picture of what I’m currently faced with:

For the master panel (the one that contains all other panels – I shall call it the master!)
I’m using the following code when creating it:
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
For each of the panels within it I’m also using the BoxLayout, but I’ve tried things like [jpanel].setAlignmentX(Component.LEFT_ALIGNMENT) on each panel but that doesn’t seem to work.
Any help would be appreciated!
🙂
edit: for the “Dimensions of box(m):” label, is there any way of aligning that to the top of the panel it’s contained in? It’s in a panel of its own.
edit: Once fixed:

Solution below, thanks all for your help 🙂
You have a number of possibilities, depending on you over all needs.
All I’ve done here is used compound panels and using
GridBagLayoutto adjust the layouts