--- old/src/share/classes/java/awt/Window.java 2009-06-16 18:37:00.000000000 +0400 +++ new/src/share/classes/java/awt/Window.java 2009-06-16 18:36:59.000000000 +0400 @@ -316,6 +316,11 @@ */ private Shape shape = null; + /** + * Indicates if the window has been packed via pack(). + */ + private boolean isPacked = false; + private static final String base = "win"; private static int nameCounter = 0; @@ -764,7 +769,7 @@ setClientSize(newSize.width, newSize.height); } - if(beforeFirstShow) { + if (beforeFirstShow) { isPacked = true; } @@ -866,7 +871,12 @@ height = minSize.height; } } - super.reshape(x, y, width, height); + synchronized (getTreeLock()) { + if (this.width != width || this.height != height) { + isPacked = false; + } + super.reshape(x, y, width, height); + } } void setClientSize(int w, int h) { @@ -1014,7 +1024,10 @@ * {@link #setVisible(boolean)}. */ @Deprecated + @Override public void hide() { + isPacked = false; + synchronized(ownedWindowList) { for (int i = 0; i < ownedWindowList.size(); i++) { Window child = ownedWindowList.elementAt(i).get(); @@ -3797,6 +3810,10 @@ { return window.calculateSecurityWarningPosition(x, y, w, h); } + + public boolean isPacked(Window window) { + return window.isPacked; + } }); // WindowAccessor } // static