java.awt.Window.removeWindowFocusListener()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(144)

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

Window.removeWindowFocusListener介绍

[英]Removes the specified window focus listener so that it no longer receives window events from this window. If l is null, no exception is thrown and no action is performed.
[中]删除指定的窗口焦点侦听器,使其不再从此窗口接收窗口事件。如果l为null,则不会引发异常,也不会执行任何操作。

代码示例

代码示例来源:origin: bobbylight/RSyntaxTextArea

private void uninstallAndHide() {
  Window parent = (Window)getParent();
  parent.removeWindowFocusListener(this);
  parent.removeWindowListener(this);
  parent.removeComponentListener(this);
  removeWindowFocusListener(this);
  setVisible(false);
  dispose();
}

代码示例来源:origin: bobbylight/RSyntaxTextArea

private void uninstallAndHide() {
  Window parent = (Window)getParent();
  parent.removeWindowFocusListener(this);
  parent.removeWindowListener(this);
  parent.removeComponentListener(this);
  removeWindowFocusListener(this);
  setVisible(false);
  dispose();
}

代码示例来源:origin: xyz.cofe/gui.swing

@Override
public void close() throws IOException {
  if(cmpt!=null && l!=null ){
    cmpt.removeWindowFocusListener(l);
    cmpt = null;
    l = null;
  }
}};

代码示例来源:origin: xyz.cofe/gui.swing

@Override
public void close() throws IOException {
  if(cmpt!=null && l!=null ){
    cmpt.removeWindowFocusListener(l);
    cmpt = null;
    l = null;
  }
}};

代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip

@Override
public void windowGainedFocus(WindowEvent e) {
  window.removeWindowFocusListener(this);
  EventQueue.invokeLater(new Runnable() {
    @Override
    public void run() {
      if (keyFile.requestFocusInWindow())
        ((JTextComponent) keyFile.getEditor().getEditorComponent()).selectAll();
    }
  });
}

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

@Override
  public void windowGainedFocus(WindowEvent evt)
  {
    SwingUtilities.invokeLater(new Runnable(){
        public void run() {
          comp.requestFocusInWindow();
        }
    });
    win.removeWindowFocusListener(this);
  }
});

代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip

@Override
public void windowGainedFocus(WindowEvent e) {
  window.removeWindowFocusListener(this);
  EventQueue.invokeLater(new Runnable() {
    @Override
    public void run() {
      if (newPasswd1Field.requestFocusInWindow()) {
        newPasswd1Field.selectAll();
        newPasswd2Field.selectAll();
      }
    }
  });
}

代码示例来源:origin: net.java.truecommons/truecommons-key-swing

@Override
public void windowGainedFocus(WindowEvent e) {
  window.removeWindowFocusListener(this);
  EventQueue.invokeLater(new Runnable() {
    @Override
    public void run() {
      if (passwdField.requestFocusInWindow())
        passwdField.selectAll();
    }
  });
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

public void removeWindow(Window window) {
    windows.remove(window);
    window.removeWindowFocusListener(focusHandler);
  }
}

代码示例来源:origin: net.java.truecommons/truecommons-key-swing

@Override
public void windowGainedFocus(WindowEvent e) {
  window.removeWindowFocusListener(this);
  EventQueue.invokeLater(new Runnable() {
    @Override
    public void run() {
      if (newPasswd1Field.requestFocusInWindow()) {
        newPasswd1Field.selectAll();
        newPasswd2Field.selectAll();
      }
    }
  });
}

代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip

@Override
public void windowGainedFocus(WindowEvent e) {
  window.removeWindowFocusListener(this);
  EventQueue.invokeLater(new Runnable() {
    @Override
    public void run() {
      if (passwdField.requestFocusInWindow())
        passwdField.selectAll();
    }
  });
}

代码示例来源:origin: freeplane/freeplane

public void trackWindowForComponent(Component c){
  final Window windowToTrack = SwingUtilities.getWindowAncestor(c);
  if(windowToTrack.equals(trackedWindow))
    return;
  if(trackedWindow != null)
    trackedWindow.removeWindowFocusListener(this);
  trackedWindow = windowToTrack;
  trackedWindow.addWindowFocusListener(this);
  mousePositionAfterFocusGained = null;
}

代码示例来源:origin: freeplane/freeplane

@Override
  public void windowGainedFocus(WindowEvent e) {
    mainView.requestFocusInWindow();
    windowAncestor.removeWindowFocusListener(this);
  }
});

代码示例来源:origin: threerings/nenya

public void ancestorRemoved (AncestorEvent e)
{
  lostFocus();
  if (_window != null) {
    _window.removeWindowFocusListener(this);
    _window = null;
  }
}

代码示例来源:origin: com.threerings/nenya

public void ancestorRemoved (AncestorEvent e)
{
  lostFocus();
  if (_window != null) {
    _window.removeWindowFocusListener(this);
    _window = null;
  }
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void windowLostFocus(WindowEvent e) {
    end = System.currentTimeMillis();
    long elapsed = end - start;
    //System.out.println(elapsed);
    if (elapsed < 100)
      window.toFront();

    window.removeWindowFocusListener(this);
  }
}

代码示例来源:origin: com.threerings/nenya

/**
 * Shuts down the key dispatcher.
 */
public void shutdown ()
{
  // cease monitoring key events
  KeyboardFocusManager.getCurrentKeyboardFocusManager().
    removeKeyEventDispatcher(this);
  // cease observing our window
  _window.removeWindowFocusListener(this);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

/**
 * Closes the window
 */
void shutdown() {
  Toolkit.getDefaultToolkit().removeAWTEventListener(this);
  if (contentWindow != null) {
    contentWindow.getOwner().removeWindowFocusListener(this);
    contentWindow.removeWindowFocusListener(this);
    contentWindow.dispose();
  }
  contentWindow = null;
}

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

private void uninstallAndHide() {
  Window parent = (Window)getParent();
  parent.removeWindowFocusListener(this);
  parent.removeWindowListener(this);
  parent.removeComponentListener(this);
  removeWindowFocusListener(this);
  setVisible(false);
  dispose();
}

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

private void uninstallAndHide() {
  Window parent = (Window)getParent();
  parent.removeWindowFocusListener(this);
  parent.removeWindowListener(this);
  parent.removeComponentListener(this);
  removeWindowFocusListener(this);
  setVisible(false);
  dispose();
}

相关文章

Window类方法