Is there a LayoutManager which will auto expand things on resize?
Say I want some JLabel aligned to the far left edge and then a button aligned to the far right edge. As the user resizes the frame these components will move to stay same distance from the edges no matter how big or small you resize.
I tried laying out some components with BorderLayout with one component WEST other one EAST and when I expand the window's width the components stay squished in the middle of the frame...
Try putting your label in the CENTER, which expands to fill the available space.Alternately, SpringLayout, BoxLayout with glue, and GridBagLayoutare all capable of doing this, as (I believe) are nested combinationsof FlowLayout and BorderLayout.
> I tried laying out some components with BorderLayout with one
> component WEST other one EAST and when I expand the window's
> width the components stay squished in the middle of the frame...
Then you aren't doing what you described, because this will work and is probably the easiest solution. You must have nested LayoutManagers which is causing a problem.
You can also you a BoxLayout and use "glue" in between the two components. Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use Layout Managers[/url] for more information.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.