use of java.awt.peer.FramePeer in project jdk8u_jdk by JetBrains.
the class Frame method remove.
/**
* 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);
}
}
}
use of java.awt.peer.FramePeer in project jdk8u_jdk by JetBrains.
the class Frame method setResizable.
/**
* 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;
}
}
// the Frame lock when we call invalidate().
if (testvalid) {
invalidateIfValid();
}
firePropertyChange("resizable", oldResizable, resizable);
}
use of java.awt.peer.FramePeer in project jdk8u_jdk by JetBrains.
the class Frame method setMenuBar.
/**
* 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);
}
}
}
}
Aggregations