Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Resize of window

Status
Not open for further replies.

jeremytaffy

Technical User
Sep 6, 2001
75
US
I have a stand alone application. When i resize the window, it moves everyting all around within the bigger window. How can i get it to stay the same, or mostly similar? Im using java 1.3
j
 
It sounds like you are having Layout Manager problems.

You are most likely using a Frame or JFrame as the basis(i.e superclass) for your application. In this case you will be using the java.awt.BorderLayout by default (this defines areas CENTER, NORTH, SOUTH, EAST, WEST - checkout the J2SE javadocs). If you resize your window then the Layout Manager will apply its rules to recalculate the Componet placements.

Use can choose the Layout Manager you want by the setLayout() method on JFrame (or Frame).

If you use setLayout(null) then you will not use any layout manager and will have to use absolute positioning. In this case when you call setSize(), setBounds(), setLocation() on your componets they will stick there no matter what sizing you do to your main window (i.e Frame or JFrame).

For more info check out the Sun tutorial :

Good luck - RjB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top