KnowledgeGeek
KnowledgeGeek

Reputation: 197

How to position buttons on a JFrame inside a JPanel

Ok, so I have:

JFrame frame = new JFrame();
JTabbedPane tabs = new JTabbedPane();
JButton button = new JButton("Add");
JPanel pane = new JPanel();

panel2.add(button);
frame.add(tabs);
myTab.addTab("Panel 2", pane);

I want to position the button in the bottom left hand corner.. How can this be made possible?

Upvotes: 0

Views: 179

Answers (1)

Rick
Rick

Reputation: 443

Have you tried using a layout manager? See http://docs.oracle.com/javase/tutorial/uiswing/layout/layoutlist.html for examples.

Upvotes: 1

Related Questions