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

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

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

JPopupMenu.getFont介绍

暂无

代码示例

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = FONT_JSDOC)
@Override
public Font getFont() {
  return super.getFont();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected JPopupMenu getPopupMenu() {
  if (memoryResPopupMenu == null) {
    memoryResPopupMenu = new JPopupMenu();
    if (GoToSource.isAvailable()) {
      Font boldfont = memoryResPopupMenu.getFont().deriveFont(Font.BOLD);
      popupShowSource = new JMenuItem();
      popupShowSource.setFont(boldfont);
      popupShowSource.setText(GO_SOURCE_POPUP_ITEM_NAME);
      memoryResPopupMenu.add(popupShowSource);
      popupShowSource.addActionListener(this);
    }
  }
  return memoryResPopupMenu;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected JPopupMenu getPopupMenu() {
  if (memoryResPopupMenu == null) {
    memoryResPopupMenu = new JPopupMenu();
    if (GoToSource.isAvailable()) {
      Font boldfont = memoryResPopupMenu.getFont().deriveFont(Font.BOLD);
      popupShowSource = new JMenuItem();
      popupShowSource.setFont(boldfont);
      popupShowSource.setText(GO_SOURCE_POPUP_ITEM_NAME);
      memoryResPopupMenu.add(popupShowSource);
      popupShowSource.addActionListener(this);
    }
  }
  return memoryResPopupMenu;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected JPopupMenu getPopupMenu() {
  if (popup == null) {
    popup = new JPopupMenu();
    if (GoToSource.isAvailable()) {
      Font boldfont = popup.getFont().deriveFont(Font.BOLD);
      popupShowSource = new JMenuItem();
      popupShowSource.setText(GO_SOURCE_POPUP_ITEM);
      popupShowSource.setFont(boldfont);
      popup.add(popupShowSource);
      popupShowSource.addActionListener(this);
    }
  }
  return popup;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected JPopupMenu initPopupMenu() {
  JPopupMenu popup = new JPopupMenu();
  Font boldfont = popup.getFont().deriveFont(Font.BOLD);
  if (GoToSource.isAvailable()) {
    popupShowSource = new JMenuItem();
    popupShowSource.setFont(boldfont);
    popupShowSource.setText(GO_SOURCE_POPUP_ITEM);
    popupShowSource.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
          if (treePath != null) {
            performDefaultAction(treePath);
          }
        }
      });
    popup.add(popupShowSource);
  }
  return popup;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected JPopupMenu createPopupMenu() {
  JPopupMenu popup = new JPopupMenu();
  if (GoToSource.isAvailable()) popupShowSource = new JMenuItem();
  popupAddToRoots = new JMenuItem();
  Font boldfont = popup.getFont().deriveFont(Font.BOLD);
  if (popupShowSource != null) {
    popupShowSource.setFont(boldfont);
    popupShowSource.setText(GO_TO_SOURCE_POPUP_ITEM);
    popup.add(popupShowSource);
    popup.addSeparator();
  }
  popupAddToRoots.setText(ADD_ROOT_METHOD_POPUP_ITEM);
  popup.add(popupAddToRoots);
  ActionListener menuListener = new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
      menuActionPerformed(evt);
    }
  };
  if (popupShowSource != null) popupShowSource.addActionListener(menuListener);
  popupAddToRoots.addActionListener(menuListener);
  return popup;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected JPopupMenu getPopupMenu() {
  if (memoryResPopupMenu == null) {
    memoryResPopupMenu = new JPopupMenu();
    if (GoToSource.isAvailable()) {
      Font boldfont = memoryResPopupMenu.getFont().deriveFont(Font.BOLD);
      popupShowSource = new JMenuItem();
      popupShowSource.setFont(boldfont);
      popupShowSource.setText(GO_SOURCE_POPUP_ITEM_NAME);
      memoryResPopupMenu.add(popupShowSource);
      popupShowSource.addActionListener(this);
    }
    if (snapshot.containsStacks()) {
      if (GoToSource.isAvailable()) memoryResPopupMenu.addSeparator();
      popupShowStacks = new JMenuItem();
      popupShowStacks.setText(SHOW_STACK_TRACES_POPUP_ITEM_NAME);
      memoryResPopupMenu.add(popupShowStacks);
      popupShowStacks.addActionListener(this);
    }
  }
  return memoryResPopupMenu;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected JPopupMenu getPopupMenu() {
  if (popup == null) {
    popup = new JPopupMenu();
    if (GoToSource.isAvailable()) {
      Font boldfont = popup.getFont().deriveFont(Font.BOLD);
      popupShowSource = new JMenuItem();
      popupShowSource.setText(GO_SOURCE_POPUP_ITEM);
      popupShowSource.setFont(boldfont);
      popup.add(popupShowSource);
      popupShowSource.addActionListener(this);
    }
    if (snapshot.containsStacks()) {
      if (GoToSource.isAvailable()) popup.addSeparator();
      popupShowStacks = new JMenuItem();
      popupShowStacks.setText(STACK_TRACES_POPUP_ITEM);
      popup.add(popupShowStacks);
      popupShowStacks.addActionListener(this);
    }
  }
  return popup;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected JPopupMenu getPopupMenu() {
  if (memoryResPopupMenu == null) {
    memoryResPopupMenu = new JPopupMenu();
    if (GoToSource.isAvailable()) {
      Font boldfont = memoryResPopupMenu.getFont().deriveFont(Font.BOLD);
      popupShowSource = new JMenuItem();
      popupShowSource.setFont(boldfont);
      popupShowSource.setText(GO_SOURCE_POPUP_ITEM_NAME);
      memoryResPopupMenu.add(popupShowSource);
      popupShowSource.addActionListener(this);
    }
    if (snapshot.containsStacks()) {
      if (GoToSource.isAvailable()) memoryResPopupMenu.addSeparator();
      popupShowStacks = new JMenuItem();
      popupShowStacks.setText(SHOW_STACK_TRACES_POPUP_ITEM_NAME);
      memoryResPopupMenu.add(popupShowStacks);
      popupShowStacks.addActionListener(this);
    }
  }
  return memoryResPopupMenu;
}

代码示例来源:origin: com.google.code.findbugs/findbugs

void updateFonts(float size) {
  bugPopupMenu.setFont(bugPopupMenu.getFont().deriveFont(size));
  mainFrame.setFontSizeHelper(size, bugPopupMenu.getComponents());
  branchPopupMenu.setFont(branchPopupMenu.getFont().deriveFont(size));
  mainFrame.setFontSizeHelper(size, branchPopupMenu.getComponents());
}

代码示例来源:origin: igvteam/igv

public JPopupMenu getPopupMenu(
    final MouseEvent evt) {
  JPopupMenu popupMenu = new IGVPopupMenu();
  JLabel popupTitle = new JLabel("  " + getName(), JLabel.CENTER);
  Font newFont = popupMenu.getFont().deriveFont(Font.BOLD, 12);
  popupTitle.setFont(newFont);
  if (popupTitle != null) {
    popupMenu.add(popupTitle);
  }
  popupMenu.addSeparator();
  // addSortMenuItem(popupMenu);
  // addPackMenuItem(popupMenu);
  // addShadeBaseMenuItem(popupMenu);
  // addCopyToClipboardItem(popupMenu, evt);
  // addGoToMate(popupMenu, evt);
  // popupMenu.addSeparator();
  //JLabel trackSettingsHeading = new JLabel("  Track Settings",
  //        JLabel.LEFT);
  //trackSettingsHeading.setFont(newFont);
  //popupMenu.add(trackSettingsHeading);
  ArrayList<Track> tmp = new ArrayList();
  tmp.add(this);
  popupMenu.add(TrackMenuUtils.getTrackRenameItem(tmp));
  popupMenu.add(TrackMenuUtils.getChangeTrackHeightItem(tmp));
  popupMenu.add(TrackMenuUtils.getDataRangeItem(tmp));
  return popupMenu;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected JPopupMenu getPopupMenu() {
  if (memoryResPopupMenu == null) {
    memoryResPopupMenu = new JPopupMenu();
    if (GoToSource.isAvailable()) {
      Font boldfont = memoryResPopupMenu.getFont().deriveFont(Font.BOLD);
      popupShowSource = new JMenuItem();
      popupShowSource.setFont(boldfont);
      popupShowSource.setText(GO_SOURCE_POPUP_ITEM_NAME);
      memoryResPopupMenu.add(popupShowSource);
      popupShowSource.addActionListener(this);
    }
    memoryResPopupMenu.addPopupMenuListener(new PopupMenuListener() {
      public void popupMenuCanceled(PopupMenuEvent e) {
      }
      public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
      }
      public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
              if (updateResultsPending) {
                updateLiveResults();
                updateResultsPending = false;
              }
            }
          });
      }
    });
  }
  return memoryResPopupMenu;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

popupFind = new JMenuItem();
Font boldfont = popup.getFont().deriveFont(Font.BOLD);

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

Font boldfont = popup.getFont().deriveFont(Font.BOLD);

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

Font boldfont = memoryResPopupMenu.getFont().deriveFont(Font.BOLD);

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

JPopupMenu popup = new JPopupMenu("My Label");
 popup.add("dummy menu item");
 Border titleUnderline = BorderFactory.createMatteBorder(1, 0, 0, 0, popup.getForeground());
 TitledBorder labelBorder = BorderFactory.createTitledBorder(
     titleUnderline, popup.getLabel(),
     TitledBorder.CENTER, TitledBorder.ABOVE_TOP, popup.getFont(), popup.getForeground());
 popup.setBorder(BorderFactory.createCompoundBorder(popup.getBorder(),
     labelBorder));
 JComponent comp = new JPanel();
 comp.setComponentPopupMenu(popup);

相关文章

JPopupMenu类方法