From 255599b960c11859d6296029c17902c5afb25d38 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 10 Jul 2002 02:02:59 +0000 Subject: [PATCH] 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 --- .../threerings/micasa/simulator/client/SimpleFrame.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/micasa/simulator/client/SimpleFrame.java b/src/java/com/threerings/micasa/simulator/client/SimpleFrame.java index ad96acf68..5e63fab96 100644 --- a/src/java/com/threerings/micasa/simulator/client/SimpleFrame.java +++ b/src/java/com/threerings/micasa/simulator/client/SimpleFrame.java @@ -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; @@ -8,6 +8,7 @@ import javax.swing.JFrame; import javax.swing.JPanel; import com.samskivert.swing.Controller; +import com.samskivert.swing.util.SwingUtil; /** * Contains the user interface for the Simulator client application. @@ -38,8 +39,9 @@ public class SimpleFrame getContentPane().removeAll(); // add the new one getContentPane().add(panel, BorderLayout.CENTER); - // swing doesn't properly repaint after adding/removing children - validate(); + // adjust ourselves to fit this lovely new child + pack(); + SwingUtil.centerWindow(this); } /**