Solved

AWT

Posted on 2002-04-05
2
285 Views
Last Modified: 2010-03-31
In AWT Frame when we set the layout as FlowLayout Manager
how can we arrange different panels at the desired position inside the frame instead of each panel adding besides the other panel implicitly.

When I used the setBounds() method on the panel, the panel is not positioned according to the given values
but it is just getting added beside an exisitng panel.
0
Comment
Question by:yrrm
2 Comments
 
LVL 2

Expert Comment

by:mzimmer74
ID: 6921452
Well, that's the way FlowLayout works.  If you want to position panels you'll need to use a different layout.  Depending on how detailed you want to be I'd suggest GridLayout, BorderLayout, or GridBagLayout going from least to most detailed.
0
 

Accepted Solution

by:
cini_gm earned 50 total points
ID: 6922442
If u want to set ur component positions using setBounds, then u must use setLayout(null). ie, If u r setting as null, then u can position ur components where ever u want. Any other layout places ur components in a fixed way.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now