本文整理匯總了Java中javax.swing.JInternalFrame.dispose方法的典型用法代碼示例。如果您正苦於以下問題:Java JInternalFrame.dispose方法的具體用法?Java JInternalFrame.dispose怎麽用?Java JInternalFrame.dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JInternalFrame
的用法示例。
在下文中一共展示了JInternalFrame.dispose方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: removeFromCanvas
import javax.swing.JInternalFrame; //導入方法依賴的package包/類
/**
* Removes the given component from this canvas.
*
* @param comp The {@code Component} to remove.
*/
public void removeFromCanvas(Component comp) {
if (comp == null) return;
final Rectangle updateBounds = comp.getBounds();
final JInternalFrame frame = getInternalFrame(comp);
notifyClose(comp, frame);
if (frame != null && frame != comp) {
frame.dispose();
} else {
// Java 1.7.0 as seen on Fedora with:
// Java version: 1.7.0_40
// Java WM version: 24.0-b56
// crashes here deep in the java libraries.
try {
super.remove(comp);
} catch (Exception e) {
logger.log(Level.WARNING, "Java crash", e);
}
}
repaint(updateBounds.x, updateBounds.y,
updateBounds.width, updateBounds.height);
}
示例2: closeMenus
import javax.swing.JInternalFrame; //導入方法依賴的package包/類
/**
* Closes all the menus that are currently open.
*/
public void closeMenus() {
for (JInternalFrame frame : getAllFrames()) {
for (Component c : frame.getContentPane().getComponents()) {
notifyClose(c, frame);
}
frame.dispose();
}
while (!dialogs.isEmpty()) {
FreeColDialog<?> dialog = dialogs.remove(0);
dialog.dispose();
}
}
示例3: closeChilds
import javax.swing.JInternalFrame; //導入方法依賴的package包/類
public void closeChilds() {
for (JInternalFrame janela : childs) {
if (janela != null) {
janela.dispose();
}
}
}
示例4: closeChilds
import javax.swing.JInternalFrame; //導入方法依賴的package包/類
public void closeChilds() {
for (JInternalFrame janela : childs) {
janela.dispose();
}
}