Using LayoutManagers

I am having trouble laying out an applet. I am trying to get two buttons to sit next to each other in the bottom-right of an applet at the same size as each other. I have tried GridBagLayout, BoxLayout, GridLayout and am now experimenting with JPanels but I'm not getting very far at all.

If someone could recommend a method for doing this I will be able to figure it out (I hope!), I just need to know what the steps to do this should be.

Thanks

[466 byte] By [danc81a] at [2007-11-27 7:40:37]
# 1
Two buttons with GridLayout into a JPanel, then the JPanel with its size set int a BorderLayouted applet, SOUTH. Something like that? http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html
CeciNEstPasUnProgrammeura at 2007-7-12 19:21:08 > top of Java-index,Java Essentials,New To Java...
# 2

final JButton left = new JButton("Left");

final JButton right = new JButton("Right");

final JPanel buttonGrid = new JPanel(new GridLayout(1, 2, 11, 0));

buttonGrid.add(left);

buttonGrid.add(right);

final JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));

buttonPane.add(buttonGrid);

final JPanel contentPane = new JPanel(new BorderLayout());

contentPane.add(buttonPane, BorderLayout.SOUTH);

thomas.behra at 2007-7-12 19:21:08 > top of Java-index,Java Essentials,New To Java...
# 3
Thanks! That was perfect!
danc81a at 2007-7-12 19:21:08 > top of Java-index,Java Essentials,New To Java...