java.awt.peer.FramePeer Java Examples

The following examples show how to use java.awt.peer.FramePeer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Frame.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Makes this Frame undisplayable by removing its connection
 * to its native screen resource. Making a Frame undisplayable
 * will cause any of its children to be made undisplayable.
 * This method is called by the toolkit internally and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #addNotify
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            // get the latest Frame state before disposing
            getState();

            if (menuBar != null) {
                mbManagement = true;
                peer.setMenuBar(null);
                menuBar.removeNotify();
            }
        }
        super.removeNotify();
    }
}
 
Example #2
Source File: DesktopWindowManagerImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
private int updateFrameBounds(JFrame frame, IdeFrameEx ideFrame) {
  int extendedState = frame.getExtendedState();
  if (SystemInfo.isMacOSLion) {
    ComponentPeer peer = AWTAccessor.getComponentAccessor().getPeer(frame);
    if (peer instanceof FramePeer) {
      // frame.state is not updated by jdk so get it directly from peer
      extendedState = ((FramePeer)peer).getState();
    }
  }
  boolean isMaximized = extendedState == Frame.MAXIMIZED_BOTH || isFullScreenSupportedInCurrentOS() && ideFrame.isInFullScreen();
  boolean usePreviousBounds = isMaximized && myFrameBounds != null && frame.getBounds().contains(new Point((int)myFrameBounds.getCenterX(), (int)myFrameBounds.getCenterY()));
  if (!usePreviousBounds) {
    myFrameBounds = frame.getBounds();
  }
  return extendedState;
}
 
Example #3
Source File: Frame.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Makes this Frame undisplayable by removing its connection
 * to its native screen resource. Making a Frame undisplayable
 * will cause any of its children to be made undisplayable.
 * This method is called by the toolkit internally and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #addNotify
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            // get the latest Frame state before disposing
            getState();

            if (menuBar != null) {
                mbManagement = true;
                peer.setMenuBar(null);
                menuBar.removeNotify();
            }
        }
        super.removeNotify();
    }
}
 
Example #4
Source File: Frame.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets whether this frame is resizable by the user.
 * @param    resizable   <code>true</code> if this frame is resizable;
 *                       <code>false</code> otherwise.
 * @see      java.awt.Frame#isResizable
 */
public void setResizable(boolean resizable) {
    boolean oldResizable = this.resizable;
    boolean testvalid = false;

    synchronized (this) {
        this.resizable = resizable;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setResizable(resizable);
            testvalid = true;
        }
    }

    // On some platforms, changing the resizable state affects
    // the insets of the Frame. If we could, we'd call invalidate()
    // from the peer, but we need to guarantee that we're not holding
    // the Frame lock when we call invalidate().
    if (testvalid) {
        invalidateIfValid();
    }
    firePropertyChange("resizable", oldResizable, resizable);
}
 
Example #5
Source File: Frame.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets the title for this frame to the specified string.
 * @param title the title to be displayed in the frame's border.
 *              A <code>null</code> value
 *              is treated as an empty string, "".
 * @see      #getTitle
 */
public void setTitle(String title) {
    String oldTitle = this.title;
    if (title == null) {
        title = "";
    }


    synchronized(this) {
        this.title = title;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setTitle(title);
        }
    }
    firePropertyChange("title", oldTitle, title);
}
 
Example #6
Source File: Frame.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets the menu bar for this frame to the specified menu bar.
 * @param     mb the menu bar being set.
 *            If this parameter is <code>null</code> then any
 *            existing menu bar on this frame is removed.
 * @see       #getMenuBar
 */
public void setMenuBar(MenuBar mb) {
    synchronized (getTreeLock()) {
        if (menuBar == mb) {
            return;
        }
        if ((mb != null) && (mb.parent != null)) {
            mb.parent.remove(mb);
        }
        if (menuBar != null) {
            remove(menuBar);
        }
        menuBar = mb;
        if (menuBar != null) {
            menuBar.parent = this;

            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                menuBar.addNotify();
                invalidateIfValid();
                peer.setMenuBar(menuBar);
            }
        }
    }
}
 
Example #7
Source File: Frame.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets the menu bar for this frame to the specified menu bar.
 * @param     mb the menu bar being set.
 *            If this parameter is <code>null</code> then any
 *            existing menu bar on this frame is removed.
 * @see       #getMenuBar
 */
public void setMenuBar(MenuBar mb) {
    synchronized (getTreeLock()) {
        if (menuBar == mb) {
            return;
        }
        if ((mb != null) && (mb.parent != null)) {
            mb.parent.remove(mb);
        }
        if (menuBar != null) {
            remove(menuBar);
        }
        menuBar = mb;
        if (menuBar != null) {
            menuBar.parent = this;

            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                menuBar.addNotify();
                invalidateIfValid();
                peer.setMenuBar(menuBar);
            }
        }
    }
}
 
Example #8
Source File: Frame.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes the specified menu bar from this frame.
 * @param    m   the menu component to remove.
 *           If <code>m</code> is <code>null</code>, then
 *           no action is taken
 */
public void remove(MenuComponent m) {
    if (m == null) {
        return;
    }
    synchronized (getTreeLock()) {
        if (m == menuBar) {
            menuBar = null;
            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                invalidateIfValid();
                peer.setMenuBar(null);
                m.removeNotify();
            }
            m.parent = null;
        } else {
            super.remove(m);
        }
    }
}
 
Example #9
Source File: Frame.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Makes this Frame undisplayable by removing its connection
 * to its native screen resource. Making a Frame undisplayable
 * will cause any of its children to be made undisplayable.
 * This method is called by the toolkit internally and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #addNotify
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            // get the latest Frame state before disposing
            getState();

            if (menuBar != null) {
                mbManagement = true;
                peer.setMenuBar(null);
                menuBar.removeNotify();
            }
        }
        super.removeNotify();
    }
}
 
Example #10
Source File: Frame.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Makes this Frame displayable by connecting it to
 * a native screen resource.  Making a frame displayable will
 * cause any of its children to be made displayable.
 * This method is called internally by the toolkit and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #removeNotify
 */
public void addNotify() {
    synchronized (getTreeLock()) {
        if (peer == null) {
            peer = getComponentFactory().createFrame(this);
        }
        FramePeer p = (FramePeer)peer;
        MenuBar menuBar = this.menuBar;
        if (menuBar != null) {
            mbManagement = true;
            menuBar.addNotify();
            p.setMenuBar(menuBar);
        }
        p.setMaximizedBounds(maximizedBounds);
        super.addNotify();
    }
}
 
Example #11
Source File: Frame.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes the specified menu bar from this frame.
 * @param    m   the menu component to remove.
 *           If <code>m</code> is <code>null</code>, then
 *           no action is taken
 */
public void remove(MenuComponent m) {
    if (m == null) {
        return;
    }
    synchronized (getTreeLock()) {
        if (m == menuBar) {
            menuBar = null;
            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                invalidateIfValid();
                peer.setMenuBar(null);
                m.removeNotify();
            }
            m.parent = null;
        } else {
            super.remove(m);
        }
    }
}
 
Example #12
Source File: Frame.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets whether this frame is resizable by the user.
 * @param    resizable   <code>true</code> if this frame is resizable;
 *                       <code>false</code> otherwise.
 * @see      java.awt.Frame#isResizable
 */
public void setResizable(boolean resizable) {
    boolean oldResizable = this.resizable;
    boolean testvalid = false;

    synchronized (this) {
        this.resizable = resizable;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setResizable(resizable);
            testvalid = true;
        }
    }

    // On some platforms, changing the resizable state affects
    // the insets of the Frame. If we could, we'd call invalidate()
    // from the peer, but we need to guarantee that we're not holding
    // the Frame lock when we call invalidate().
    if (testvalid) {
        invalidateIfValid();
    }
    firePropertyChange("resizable", oldResizable, resizable);
}
 
Example #13
Source File: Frame.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Makes this Frame undisplayable by removing its connection
 * to its native screen resource. Making a Frame undisplayable
 * will cause any of its children to be made undisplayable.
 * This method is called by the toolkit internally and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #addNotify
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            // get the latest Frame state before disposing
            getState();

            if (menuBar != null) {
                mbManagement = true;
                peer.setMenuBar(null);
                menuBar.removeNotify();
            }
        }
        super.removeNotify();
    }
}
 
Example #14
Source File: Frame.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Makes this Frame displayable by connecting it to
 * a native screen resource.  Making a frame displayable will
 * cause any of its children to be made displayable.
 * This method is called internally by the toolkit and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #removeNotify
 */
public void addNotify() {
    synchronized (getTreeLock()) {
        if (peer == null) {
            peer = getToolkit().createFrame(this);
        }
        FramePeer p = (FramePeer)peer;
        MenuBar menuBar = this.menuBar;
        if (menuBar != null) {
            mbManagement = true;
            menuBar.addNotify();
            p.setMenuBar(menuBar);
        }
        p.setMaximizedBounds(maximizedBounds);
        super.addNotify();
    }
}
 
Example #15
Source File: Frame.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Makes this Frame undisplayable by removing its connection
 * to its native screen resource. Making a Frame undisplayable
 * will cause any of its children to be made undisplayable.
 * This method is called by the toolkit internally and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #addNotify
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            // get the latest Frame state before disposing
            getState();

            if (menuBar != null) {
                mbManagement = true;
                peer.setMenuBar(null);
                menuBar.removeNotify();
            }
        }
        super.removeNotify();
    }
}
 
Example #16
Source File: Frame.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Makes this Frame undisplayable by removing its connection
 * to its native screen resource. Making a Frame undisplayable
 * will cause any of its children to be made undisplayable.
 * This method is called by the toolkit internally and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #addNotify
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            // get the latest Frame state before disposing
            getState();

            if (menuBar != null) {
                mbManagement = true;
                peer.setMenuBar(null);
                menuBar.removeNotify();
            }
        }
        super.removeNotify();
    }
}
 
Example #17
Source File: WEmbeddedFrame.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void synthesizeWindowActivation(final boolean activate) {
    final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this);
    if (!activate || EventQueue.isDispatchThread()) {
        peer.emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                peer.emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #18
Source File: Frame.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets the menu bar for this frame to the specified menu bar.
 * @param     mb the menu bar being set.
 *            If this parameter is <code>null</code> then any
 *            existing menu bar on this frame is removed.
 * @see       #getMenuBar
 */
public void setMenuBar(MenuBar mb) {
    synchronized (getTreeLock()) {
        if (menuBar == mb) {
            return;
        }
        if ((mb != null) && (mb.parent != null)) {
            mb.parent.remove(mb);
        }
        if (menuBar != null) {
            remove(menuBar);
        }
        menuBar = mb;
        if (menuBar != null) {
            menuBar.parent = this;

            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                menuBar.addNotify();
                invalidateIfValid();
                peer.setMenuBar(menuBar);
            }
        }
    }
}
 
Example #19
Source File: Frame.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets whether this frame is resizable by the user.
 * @param    resizable   {@code true} if this frame is resizable;
 *                       {@code false} otherwise.
 * @see      java.awt.Frame#isResizable
 */
public void setResizable(boolean resizable) {
    boolean oldResizable = this.resizable;
    boolean testvalid = false;

    synchronized (this) {
        this.resizable = resizable;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setResizable(resizable);
            testvalid = true;
        }
    }

    // On some platforms, changing the resizable state affects
    // the insets of the Frame. If we could, we'd call invalidate()
    // from the peer, but we need to guarantee that we're not holding
    // the Frame lock when we call invalidate().
    if (testvalid) {
        invalidateIfValid();
    }
    firePropertyChange("resizable", oldResizable, resizable);
}
 
Example #20
Source File: Frame.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Makes this Frame displayable by connecting it to
 * a native screen resource.  Making a frame displayable will
 * cause any of its children to be made displayable.
 * This method is called internally by the toolkit and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #removeNotify
 */
public void addNotify() {
    synchronized (getTreeLock()) {
        if (peer == null) {
            peer = getToolkit().createFrame(this);
        }
        FramePeer p = (FramePeer)peer;
        MenuBar menuBar = this.menuBar;
        if (menuBar != null) {
            mbManagement = true;
            menuBar.addNotify();
            p.setMenuBar(menuBar);
        }
        p.setMaximizedBounds(maximizedBounds);
        super.addNotify();
    }
}
 
Example #21
Source File: Frame.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Makes this Frame undisplayable by removing its connection
 * to its native screen resource. Making a Frame undisplayable
 * will cause any of its children to be made undisplayable.
 * This method is called by the toolkit internally and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #addNotify
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            // get the latest Frame state before disposing
            getState();

            if (menuBar != null) {
                mbManagement = true;
                peer.setMenuBar(null);
                menuBar.removeNotify();
            }
        }
        super.removeNotify();
    }
}
 
Example #22
Source File: Frame.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets whether this frame is resizable by the user.
 * @param    resizable   <code>true</code> if this frame is resizable;
 *                       <code>false</code> otherwise.
 * @see      java.awt.Frame#isResizable
 */
public void setResizable(boolean resizable) {
    boolean oldResizable = this.resizable;
    boolean testvalid = false;

    synchronized (this) {
        this.resizable = resizable;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setResizable(resizable);
            testvalid = true;
        }
    }

    // On some platforms, changing the resizable state affects
    // the insets of the Frame. If we could, we'd call invalidate()
    // from the peer, but we need to guarantee that we're not holding
    // the Frame lock when we call invalidate().
    if (testvalid) {
        invalidateIfValid();
    }
    firePropertyChange("resizable", oldResizable, resizable);
}
 
Example #23
Source File: Frame.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Sets whether this frame is resizable by the user.
 * @param    resizable   <code>true</code> if this frame is resizable;
 *                       <code>false</code> otherwise.
 * @see      java.awt.Frame#isResizable
 */
public void setResizable(boolean resizable) {
    boolean oldResizable = this.resizable;
    boolean testvalid = false;

    synchronized (this) {
        this.resizable = resizable;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setResizable(resizable);
            testvalid = true;
        }
    }

    // On some platforms, changing the resizable state affects
    // the insets of the Frame. If we could, we'd call invalidate()
    // from the peer, but we need to guarantee that we're not holding
    // the Frame lock when we call invalidate().
    if (testvalid) {
        invalidateIfValid();
    }
    firePropertyChange("resizable", oldResizable, resizable);
}
 
Example #24
Source File: Frame.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Sets the menu bar for this frame to the specified menu bar.
 * @param     mb the menu bar being set.
 *            If this parameter is <code>null</code> then any
 *            existing menu bar on this frame is removed.
 * @see       #getMenuBar
 */
public void setMenuBar(MenuBar mb) {
    synchronized (getTreeLock()) {
        if (menuBar == mb) {
            return;
        }
        if ((mb != null) && (mb.parent != null)) {
            mb.parent.remove(mb);
        }
        if (menuBar != null) {
            remove(menuBar);
        }
        menuBar = mb;
        if (menuBar != null) {
            menuBar.parent = this;

            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                menuBar.addNotify();
                invalidateIfValid();
                peer.setMenuBar(menuBar);
            }
        }
    }
}
 
Example #25
Source File: Frame.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Sets the title for this frame to the specified string.
 * @param title the title to be displayed in the frame's border.
 *              A <code>null</code> value
 *              is treated as an empty string, "".
 * @see      #getTitle
 */
public void setTitle(String title) {
    String oldTitle = this.title;
    if (title == null) {
        title = "";
    }


    synchronized(this) {
        this.title = title;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setTitle(title);
        }
    }
    firePropertyChange("title", oldTitle, title);
}
 
Example #26
Source File: Frame.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Makes this Frame displayable by connecting it to
 * a native screen resource.  Making a frame displayable will
 * cause any of its children to be made displayable.
 * This method is called internally by the toolkit and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #removeNotify
 */
public void addNotify() {
    synchronized (getTreeLock()) {
        if (peer == null) {
            peer = getToolkit().createFrame(this);
        }
        FramePeer p = (FramePeer)peer;
        MenuBar menuBar = this.menuBar;
        if (menuBar != null) {
            mbManagement = true;
            menuBar.addNotify();
            p.setMenuBar(menuBar);
        }
        p.setMaximizedBounds(maximizedBounds);
        super.addNotify();
    }
}
 
Example #27
Source File: Frame.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * Sets the menu bar for this frame to the specified menu bar.
 * @param     mb the menu bar being set.
 *            If this parameter is <code>null</code> then any
 *            existing menu bar on this frame is removed.
 * @see       #getMenuBar
 */
public void setMenuBar(MenuBar mb) {
    synchronized (getTreeLock()) {
        if (menuBar == mb) {
            return;
        }
        if ((mb != null) && (mb.parent != null)) {
            mb.parent.remove(mb);
        }
        if (menuBar != null) {
            remove(menuBar);
        }
        menuBar = mb;
        if (menuBar != null) {
            menuBar.parent = this;

            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                menuBar.addNotify();
                invalidateIfValid();
                peer.setMenuBar(menuBar);
            }
        }
    }
}
 
Example #28
Source File: Frame.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Makes this Frame undisplayable by removing its connection
 * to its native screen resource. Making a Frame undisplayable
 * will cause any of its children to be made undisplayable.
 * This method is called by the toolkit internally and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #addNotify
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            // get the latest Frame state before disposing
            getState();

            if (menuBar != null) {
                mbManagement = true;
                peer.setMenuBar(null);
                menuBar.removeNotify();
            }
        }
        super.removeNotify();
    }
}
 
Example #29
Source File: Frame.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes the specified menu bar from this frame.
 * @param    m   the menu component to remove.
 *           If <code>m</code> is <code>null</code>, then
 *           no action is taken
 */
public void remove(MenuComponent m) {
    if (m == null) {
        return;
    }
    synchronized (getTreeLock()) {
        if (m == menuBar) {
            menuBar = null;
            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                invalidateIfValid();
                peer.setMenuBar(null);
                m.removeNotify();
            }
            m.parent = null;
        } else {
            super.remove(m);
        }
    }
}
 
Example #30
Source File: Frame.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets whether this frame is resizable by the user.
 * @param    resizable   <code>true</code> if this frame is resizable;
 *                       <code>false</code> otherwise.
 * @see      java.awt.Frame#isResizable
 */
public void setResizable(boolean resizable) {
    boolean oldResizable = this.resizable;
    boolean testvalid = false;

    synchronized (this) {
        this.resizable = resizable;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setResizable(resizable);
            testvalid = true;
        }
    }

    // On some platforms, changing the resizable state affects
    // the insets of the Frame. If we could, we'd call invalidate()
    // from the peer, but we need to guarantee that we're not holding
    // the Frame lock when we call invalidate().
    if (testvalid) {
        invalidateIfValid();
    }
    firePropertyChange("resizable", oldResizable, resizable);
}