javax.swing.JFrame.removeComponentListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中javax.swing.JFrame.removeComponentListener()方法的一些代码示例,展示了JFrame.removeComponentListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.removeComponentListener()方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:removeComponentListener

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();
  }
});

相关文章

JFrame类方法