• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Layout Problem

Please follow the link below. I got a layout problem. Thanx
http://www.penne.jp/layoutprob.htm
0
asukai
Asked:
asukai
  • 2
1 Solution
 
CEHJCommented:
Try

toolBar.setLayout(new FlowLayout());
0
 
asukaiAuthor Commented:
It brings all the componets to the center of the toolbar.
0
 
CEHJCommented:
Sorry:

toolBar.setLayout(new FlowLayout(FlowLayout.LEFT));
0
 
sct75Commented:
Other than trying FlowLayout, you might consider BorderLayout. Following is the code based on your source code on the site.

TestFrame()
{
setSize(500, 500);
JToolBar toolBar= new JToolBar();
toolBar.setLayout(new BorderLayout());
toolBar.add(new JButton("Test1"), BorderLayout.WEST);
toolBar.add(new JTextField(), BorderLayout.CENTER);
toolBar.add(new JLabel("px"), BorderLayout.EAST);
Container contentPane = getContentPane();
contentPane.add(toolBar,BorderLayout.NORTH);
}
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now