javax.swing.JPopupMenu.setVisible()方法的使用及代码示例

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

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

JPopupMenu.setVisible介绍

暂无

代码示例

代码示例来源:origin: chewiebug/GCViewer

public void actionPerformed(ActionEvent e) {
    TimeOffsetPanel.this.popup.setVisible(false);
  }
});

代码示例来源:origin: chewiebug/GCViewer

public void actionPerformed(ActionEvent e) {
    TimeOffsetPanel.this.popup.setVisible(false);
    fireTimeOffsetPanelStateChanged(setOffsetCheckBox.isSelected());
  }
});

代码示例来源:origin: deathmarine/Luyten

private void refreshMenuPopup(JMenu menu) {
    try {
      if (menu.isPopupMenuVisible()) {
        menu.getPopupMenu().setVisible(false);
        menu.getPopupMenu().setVisible(true);
      }
    } catch (Exception e) {
      Luyten.showExceptionDialog("Exception!", e);
    }
  }
}.start();

代码示例来源:origin: org.netbeans.api/org-openide-awt

@Override
public void mouseClicked(MouseEvent e) {
  if(popup.isShowing()) {
    popup.setVisible(false);
  } else {
    displayOverflow();
  }
}

代码示例来源:origin: magefree/mage

private void applyNewKeycode(int code) {
  preferences.getKeybindButtons().stream()
      .filter(b -> b != KeyBindButton.this)
      .filter(b -> {
        return b.keyCode == code;
      })
      .forEach(b -> b.setKeyCode(0));
  setKeyCode(code);
  menu.setVisible(false);
}

代码示例来源:origin: magefree/mage

/**
 * Hides the text popup window
 */
public void hideTooltipPopup() {
  this.tooltipCard = null;
  if (tooltipPopup != null) {
    tooltipPopup.hide();
  }
  if (jPopupMenu != null) {
    jPopupMenu.setVisible(false);
  }
  try {
    if (SessionHandler.getSession() == null) {
      return;
    }
    // set enlarged card display to visible = false
    Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER);
    popupContainer.setVisible(false);
  } catch (Exception e2) {
    LOGGER.warn("Can't set tooltip to visible = false", e2);
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

popup.setVisible(false);
popup.setVisible(true);

代码示例来源:origin: org.netbeans.api/org-openide-awt

popup.setVisible(false);
popup.setVisible(true);

代码示例来源:origin: org.netbeans.api/org-openide-awt

private void displayOverflow() {
  int x = getOrientation() == HORIZONTAL ? overflowButton.getLocationOnScreen().x : overflowButton.getLocationOnScreen().x + overflowButton.getWidth();
  int y = getOrientation() == HORIZONTAL ? overflowButton.getLocationOnScreen().y + overflowButton.getHeight() : overflowButton.getLocationOnScreen().y;
  popup.setLocation(x, y);
  popup.setVisible(true);
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

MouseEvent e = (MouseEvent) event;
if(isVisible() && !isShowing() && popup.isShowing()) {
  popup.setVisible(false);
  return;
    int maxY = popup.getLocationOnScreen().y + popup.getHeight();
    if (e.getXOnScreen() < minX || e.getXOnScreen() >= maxX || e.getYOnScreen() < minY || e.getYOnScreen() >= maxY) {
      popup.setVisible(false);
        || (getOrientation() == VERTICAL && e.getXOnScreen() >= minX && e.getXOnScreen() < maxX_ob
            && e.getYOnScreen() > maxY_ob)) {
      popup.setVisible(false);

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

@Override
public void setVisible(boolean visible) {
  super.setVisible(visible);
  if(visible){
    return;
  }
  table.requestFocusInWindow();
}

代码示例来源:origin: edu.toronto.cs.savant/savant-core

public static void hidePopup() {
  if (activePopup != null) {
    activePopup.setVisible(false);
    activePopup = null;
  }
  if (activeHost != null) {
    activeHost.popupHidden();
    activeHost = null;
  }
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

public void doFocusLost__on__$JPanel0(FocusEvent event) {
  if (log.isDebugEnabled()) {
    log.debug(event);
  }
  setPopupVisible(false);popup.setVisible(false);
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

protected void hidePopup() {
  if (popup.isVisible()) {
    popup.setVisible(false);
  }
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

protected void hidePopup() {
  if (popup.isVisible()) {
    popup.setVisible(false);
  }
}

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

@Override
protected void hideAutocompletionPopup() {
  synchronized (popup) {
    if (popup.isVisible())
      popup.setVisible(false);
  }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

public void actionPerformed(ActionEvent e) {
  if (((GOETreeNode)tree.getLastSelectedPathComponent()).isLeaf()) {
   popup.setVisible(false);
  }
 }
});

代码示例来源:origin: xyz.cofe/docking-frames-core

public void cancel(){
  if( menu != null ){	
    JPopupMenu menu = this.menu;
    this.menu = null;
    menu.setVisible( false );
    
    for( CombinedMenuContentListener listener : listeners() ){
      listener.canceled( this );
    }
  }
}

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

@Override
protected void hideAutocompletionPopup() {
  synchronized (popup) {
    if (popup.isVisible())
      popup.setVisible(false);
    autocompletedtextComp.getDocument().removeDocumentListener(documentListener);
  }
}

代码示例来源:origin: org.japura/japura-gui

private void chooseSelectedListItem() {
 if (getList().getSelectedIndex() > -1) {
  T item = (T) getList().getSelectedValue();
  String text = getValueToString().valueToString(item);
  getField().setText(text);
  getPopup().setVisible(false);
  for (DropDownFilteredListListener listener : getListeners()) {
   listener.itemSelected(text);
  }
 }
}

相关文章

JPopupMenu类方法