I'm pretty nooby at layouts... for my application I want to put a panel in the bottom-left corner, with padding, but I'm not sure which layout to use.
I tried using a BorderLayout coupled with horizontal alignment in order to position the panel in the corner, but it did not produce the expected result. My code is as follows:
final JLabel label = new JLabel();
label.setBorder(new EmptyBorder(20, 20, 20, 20));
label.setHorizontalAlignment(JLabel.LEFT);
label.setPreferredSize(new Dimension(100,100));
label.setBackground(Color.WHITE);
label.setOpaque(true);
add(label, BorderLayout.SOUTH);
(the outer class extends JFrame)
The image below details what I want, and what I have.
Any tips to achieve this layout? It seems rather simple, but again, I'm new to layouts