Alignment in Swing-BoxLayout

  • Thread starter Christian Otteneuer
  • Start date
C

Christian Otteneuer

Hallo NG,

somehow, I am lost in my source code. :( I hope, you can help me. I have
the following problem:

I have a JPanel and a JButton which I add to another JPanel

JPanel mainPanel();
mainPanel.setLayout(new BoxLayout(mainPanel,BoxLayout.LINE_AXIS));
JPanel internalPanel();
....
JButton myButton();
....
mainPanel.add(internalPanel);
mainPanel.add(myButton);

I want to arrange the 2 components on the _bottom_ of mainPanel. A
tutorial is here:
http://java.sun.com/docs/books/tutorial/uiswing/layout/box.html#alignment

Unfortunately, I don't understand the example :(

Can anyone help me and give me a hint how I have to change my source code?

Cheers,

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top