Resize the simple frame to fit the place view when it is provided with a
new one. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1568 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: SimpleFrame.java,v 1.1 2002/01/16 02:59:08 mdb Exp $
|
// $Id: SimpleFrame.java,v 1.2 2002/07/10 02:02:59 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.micasa.simulator.client;
|
package com.threerings.micasa.simulator.client;
|
||||||
|
|
||||||
@@ -8,6 +8,7 @@ import javax.swing.JFrame;
|
|||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import com.samskivert.swing.Controller;
|
import com.samskivert.swing.Controller;
|
||||||
|
import com.samskivert.swing.util.SwingUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the user interface for the Simulator client application.
|
* Contains the user interface for the Simulator client application.
|
||||||
@@ -38,8 +39,9 @@ public class SimpleFrame
|
|||||||
getContentPane().removeAll();
|
getContentPane().removeAll();
|
||||||
// add the new one
|
// add the new one
|
||||||
getContentPane().add(panel, BorderLayout.CENTER);
|
getContentPane().add(panel, BorderLayout.CENTER);
|
||||||
// swing doesn't properly repaint after adding/removing children
|
// adjust ourselves to fit this lovely new child
|
||||||
validate();
|
pack();
|
||||||
|
SwingUtil.centerWindow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user