?
Solved

Layout Problem

Posted on 2003-03-08
4
Medium Priority
?
216 Views
Last Modified: 2010-03-31
Please follow the link below. I got a layout problem. Thanx
http://www.penne.jp/layoutprob.htm
0
Comment
Question by:asukai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 8093827
Try

toolBar.setLayout(new FlowLayout());
0
 

Author Comment

by:asukai
ID: 8093955
It brings all the componets to the center of the toolbar.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 200 total points
ID: 8093967
Sorry:

toolBar.setLayout(new FlowLayout(FlowLayout.LEFT));
0
 
LVL 1

Expert Comment

by:sct75
ID: 8094365
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses
Course of the Month8 days, 17 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question