本文整理了Java中javax.swing.JFrame.removeComponentListener()
方法的一些代码示例,展示了JFrame.removeComponentListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.removeComponentListener()
方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:removeComponentListener
暂无
代码示例来源:origin: graphstream/gs-core
public void openInAFrame(boolean on) {
if (on) {
if (frame == null) {
frame = new JFrame("GraphStream");
frame.setLayout(new BorderLayout());
frame.add(this, BorderLayout.CENTER);
frame.setSize(800, 600);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
frame.addWindowListener(this);
frame.addComponentListener(this);
frame.addKeyListener(shortcuts);
} else {
frame.setVisible(true);
}
} else {
if (frame != null) {
frame.removeComponentListener(this);
frame.removeWindowListener(this);
frame.removeKeyListener(shortcuts);
frame.remove(this);
frame.setVisible(false);
frame.dispose();
}
}
}
代码示例来源:origin: org.graphstream/gs-core
public void openInAFrame(boolean on) {
if (on) {
if (frame == null) {
frame = new JFrame("GraphStream");
frame.setLayout(new BorderLayout());
frame.add(this, BorderLayout.CENTER);
frame.setSize(800, 600);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
frame.addWindowListener(this);
frame.addComponentListener(this);
frame.addKeyListener(shortcuts);
} else {
frame.setVisible(true);
}
} else {
if (frame != null) {
frame.removeComponentListener(this);
frame.removeWindowListener(this);
frame.removeKeyListener(shortcuts);
frame.remove(this);
frame.setVisible(false);
frame.dispose();
}
}
}
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
@Override
public
void run() {
look.close();
glassPane.remove(notifyCanvas);
appWindow.removeWindowStateListener(windowStateListener);
appWindow.removeComponentListener(parentListener);
boolean found = false;
Component[] components = glassPane.getComponents();
for (Component component : components) {
if (component instanceof NotifyCanvas) {
found = true;
break;
}
}
if (!found) {
// hide the glass pane if there are no more notifications on it.
glassPane.setVisible(false);
}
notification.onClose();
}
});
内容来源于网络,如有侵权,请联系作者删除!