FlowLayout issue

I have added 3 components(1 label, 1 textfield and 1 button) in a panel using a FlowLayout manager.

All these 3 components are now left alligned.

I want to keep the label and the textfield left alligned and I want to move the button to the right side of my panel.

How can I move the button to the right side? (keeping the FlowLayout manager)

10x

[376 byte] By [aditma] at [2007-11-27 0:19:07]
# 1
I don't think FlowLayout is meant to do that. Try looking for another [url= http://java.sun.com/j2se/1.5.0/docs/api/java/awt/LayoutManager.html]LayoutManager[/url] that suits your needs better. You might have to put the two left-justified buttons in their own container.
CaptainMorgan08a at 2007-7-11 22:10:16 > top of Java-index,Java Essentials,Java Programming...
# 2
A Box is good for this because you can add "Glue" after the first two componentswhich will push the last to the right.
pbrockway2a at 2007-7-11 22:10:16 > top of Java-index,Java Essentials,Java Programming...
# 3
Insert a rigidarea after you add the textfield. Or else you can insert a blank label after the textfield. Both these would work.
qUesT_foR_knOwLeDgea at 2007-7-11 22:10:16 > top of Java-index,Java Essentials,Java Programming...
# 4
As Captain and pbrock suggested that you shift to some other layout, even i would suggest you to shift to a more flexible layout manager like GridBagLayout where you can diveide the container into grids and assign your components to specific grids.
qUesT_foR_knOwLeDgea at 2007-7-11 22:10:16 > top of Java-index,Java Essentials,Java Programming...
# 5
many thanks colleagues.finally I have used a combination between BorderLayout and Flow Layout.It works super now.
aditma at 2007-7-11 22:10:16 > top of Java-index,Java Essentials,Java Programming...