javax.swing.JInternalFrame.setComponentPopupMenu()方法的使用及代码示例

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

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

JInternalFrame.setComponentPopupMenu介绍

暂无

代码示例

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

public void propertyChange(PropertyChangeEvent evt) {
    Content content = (Content) evt.getSource();
    if (content.isMinimized())
      return;
    if (!content.isDetached()) {
      JInternalFrame internalFrame = getInternalFrame(content);
      if (internalFrame != null)
        internalFrame.setComponentPopupMenu((JPopupMenu) evt.getNewValue());
      else
        throw new IllegalStateException("Invalid content ui state.");
    }
  }
}

代码示例来源:origin: khuxtable/seaglass

protected void uninstallComponents() {
  if (frame.getComponentPopupMenu() instanceof UIResource) {
    frame.setComponentPopupMenu(null);
  }
  super.uninstallComponents();
}

代码示例来源:origin: khuxtable/seaglass

/**
 * Create the system menu.
 */
private void assembleSystemMenu() {
  systemPopupMenu = new JPopupMenuUIResource();
  addSystemMenuItems(systemPopupMenu);
  enableActions();
  menuButton = new NoFocusButton("InternalFrameTitlePane.menuButtonAccessibleName");
  updateMenuIcon();
  menuButton.addMouseListener(new MouseAdapter() {
      public void mousePressed(MouseEvent e) {
        try {
          frame.setSelected(true);
        } catch (PropertyVetoException pve) {
        }
        showSystemMenu();
      }
    });
  JPopupMenu p = frame.getComponentPopupMenu();
  if (p == null || p instanceof UIResource) {
    frame.setComponentPopupMenu(systemPopupMenu);
  }
  if (frame.getDesktopIcon() != null) {
    p = frame.getDesktopIcon().getComponentPopupMenu();
    if (p == null || p instanceof UIResource) {
      frame.getDesktopIcon().setComponentPopupMenu(systemPopupMenu);
    }
  }
  setInheritsPopupMenu(true);
}

相关文章

JInternalFrame类方法