javax.swing.JWindow.setFocusableWindowState()方法的使用及代码示例

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

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

JWindow.setFocusableWindowState介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

JWindow myWindow = ...
myWindow.setFocusableWindowState(true);
myWindow.setFocusable(true);

代码示例来源:origin: stackoverflow.com

JFrame owner = new JFrame();
 owner.setVisible(true);
 JWindow window = new JWindow(owner);
 window.setFocusableWindowState(true);
 window.add(new JTextField("edit me"));
 window.setSize(200, 200);
 window.setVisible(true);

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

private void createPopupWindow() {
    JScrollPane sp = ComponentFactory.createScrollPane(popupList);
    popupWindow = new JWindow((Window) SwingUtilities.getAncestorOfClass(Window.class, textComponent));
//        popupWindow.setAlwaysOnTop(true); // this doesn't appear to work with certain Windows/java combinations
    popupWindow.getContentPane().setLayout(new BorderLayout());
    popupWindow.getContentPane().add(sp, BorderLayout.CENTER);
    popupWindow.setFocusableWindowState(false);
  }

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

private void createPopupWindow() {
    JScrollPane sp = ComponentFactory.createScrollPane(popupList);
    popupWindow = new JWindow((Window) SwingUtilities.getAncestorOfClass(Window.class, textComponent));
//        popupWindow.setAlwaysOnTop(true); // this doesn't appear to work with certain Windows/java combinations
    popupWindow.getContentPane().setLayout(new BorderLayout());
    popupWindow.getContentPane().add(sp, BorderLayout.CENTER);
    popupWindow.setFocusableWindowState(false);
  }

代码示例来源:origin: protegeproject/protege

private void createPopupWindow() {
    JScrollPane sp = ComponentFactory.createScrollPane(popupList);
    popupWindow = new JWindow((Window) SwingUtilities.getAncestorOfClass(Window.class, textComponent));
//        popupWindow.setAlwaysOnTop(true); // this doesn't appear to work with certain Windows/java combinations
    popupWindow.getContentPane().setLayout(new BorderLayout());
    popupWindow.getContentPane().add(sp, BorderLayout.CENTER);
    popupWindow.setFocusableWindowState(false);
  }

代码示例来源:origin: org.protege/protege-editor-owl

private void createPopupWindow() {
    JScrollPane sp = ComponentFactory.createScrollPane(popupList);
    popupWindow = new JWindow((Window) SwingUtilities.getAncestorOfClass(Window.class, textComponent));
//        popupWindow.setAlwaysOnTop(true); // this doesn't appear to work with certain Windows/java combinations
    popupWindow.getContentPane().setLayout(new BorderLayout());
    popupWindow.getContentPane().add(sp, BorderLayout.CENTER);
    popupWindow.setFocusableWindowState(false);
  }

代码示例来源:origin: protegeproject/protege

private JWindow getWindow() {
  if (window == null) {
    Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);
    window = new JWindow(w);
    window.setFocusableWindowState(false);
    JPanel popupContent = new JPanel(new BorderLayout(3, 3));
    popupContent.add(searchPanel);
    window.setContentPane(popupContent);
    addFocusListener(new FocusAdapter() {
      public void focusLost(FocusEvent e) {
        window.setVisible(false);
      }
    });
    SwingUtilities.getRoot(this).addComponentListener(new ComponentAdapter() {
      public void componentMoved(ComponentEvent e) {
        closeResults();
      }
    });
  }
  return window;
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

private JWindow getWindow() {
  if (window == null) {
    Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);
    window = new JWindow(w);
    window.setFocusableWindowState(false);
    JPanel popupContent = new JPanel(new BorderLayout(3, 3));
    popupContent.add(searchPanel);
    window.setContentPane(popupContent);
    addFocusListener(new FocusAdapter() {
      public void focusLost(FocusEvent e) {
        window.setVisible(false);
      }
    });
    SwingUtilities.getRoot(this).addComponentListener(new ComponentAdapter() {
      public void componentMoved(ComponentEvent e) {
        closeResults();
      }
    });
  }
  return window;
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

private JWindow getWindow() {
  if (window == null) {
    Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);
    window = new JWindow(w);
    window.setFocusableWindowState(false);
    JPanel popupContent = new JPanel(new BorderLayout(3, 3));
    popupContent.add(searchPanel);
    window.setContentPane(popupContent);
    addFocusListener(new FocusAdapter() {
      public void focusLost(FocusEvent e) {
        window.setVisible(false);
      }
    });
    SwingUtilities.getRoot(this).addComponentListener(new ComponentAdapter() {
      public void componentMoved(ComponentEvent e) {
        closeResults();
      }
    });
  }
  return window;
}

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

tooltip.setFocusableWindowState(false);

代码示例来源:origin: com.fifesoft.rtext/fife.common

/**
 * Creates the popup window for this text field.
 *
 * @return The popup window.
 */
private JWindow createPopupWindow() {
  //System.err.println("... Creating a new popupWindow!");
  JWindow popupWindow = new JWindow(parent);
  popupWindow.setFocusableWindowState(false);
  popupWindow.setContentPane(contentPane);
  popupWindow.applyComponentOrientation(getComponentOrientation());
  return popupWindow;
}

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

window.setFocusableWindowState(false);
window.setAutoRequestFocus(false);
window.setAlwaysOnTop(true);

代码示例来源:origin: otros-systems/otroslogviewer

setSuggestionWindowLocation();
if (!suggestionWindow.isVisible()) {
 suggestionWindow.setFocusableWindowState(false);
 suggestionWindow.setVisible(true);
 suggestionWindow.setFocusableWindowState(true);

代码示例来源:origin: com.synaptix/SynaptixWidget

computeLocation();
  window.setFocusable(false);
  window.setFocusableWindowState(false);
  window.setVisible(true);
} else {

代码示例来源:origin: igniterealtime/Spark

public void display(ContactGroup group, MouseEvent e) {
  int loc = group.getList().locationToIndex(e.getPoint());
  ContactItem item = (ContactItem)group.getList().getModel().getElementAt(loc);
  if (item == null || item.getJID() == null) {
    return;
  }
  if (getContactItem() != null && getContactItem() == item) {
    return;
  }
  iconLabel.setIcon(item.getIcon());
  Point point = group.getList().indexToLocation(loc);
  window.setFocusableWindowState(false);
  setContactItem(item);
  window.pack();
  Point mainWindowLocation = SparkManager.getMainWindow().getLocationOnScreen();
  Point listLocation = group.getList().getLocationOnScreen();
  int x = (int)mainWindowLocation.getX() + SparkManager.getMainWindow().getWidth();
  int y = (int) listLocation.getY() + (int) point.getY();
  setWindowLocation(x, y);
  if (!window.isVisible()) {
    window.setVisible(true);
  }
}

代码示例来源:origin: org.protege/protege-editor-owl

private JWindow getWindow() {
  if (window == null) {
    Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);
    window = new JWindow(w);
    window.setFocusableWindowState(false);
    JScrollPane sp = ComponentFactory.createScrollPane(resultsList);
    sp.setBorder(null);
    window.setContentPane(sp);
    addFocusListener(new FocusAdapter() {
      public void focusLost(FocusEvent e) {
        window.setVisible(false);
        resultsList.setListData(new Object []{});
      }
    });
    SwingUtilities.getRoot(this).addComponentListener(new ComponentAdapter() {
      public void componentMoved(ComponentEvent e) {
        closeResults();
      }
    });
  }
  return window;
}

代码示例来源:origin: PsiLupan/MakeLobbiesGreatAgain

frame = new JWindow();
frame.setBackground(new Color(0, 0, 0, 0));
frame.setFocusableWindowState(false);

相关文章