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

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

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

JPopupMenu.setBorder介绍

暂无

代码示例

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

popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
popupMenu.add(openXpTracker);
popupMenu.add(reset);

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

/**
 * Creates a new tool bar with a specified
 * <code>name</code> and
 * <code>orientation</code>. All other constructors call this constructor.
 * If
 * <code>orientation</code> is an invalid value, an exception will be
 * thrown.
 *
 * @param name the name of the tool bar
 * @param orientation the initial orientation -- it must be     *        either <code>HORIZONTAL</code> or <code>VERTICAL</code>
 * @exception IllegalArgumentException if orientation is neither
 * <code>HORIZONTAL</code> nor <code>VERTICAL</code>
 */
public ToolbarWithOverflow(String name, int orientation) {
  super(name, orientation);
  setupOverflowButton();
  popup = new JPopupMenu();
  popup.setBorderPainted(false);
  popup.setBorder(BorderFactory.createEmptyBorder());
  overflowToolbar = new JToolBar("overflowToolbar", orientation == HORIZONTAL ? VERTICAL : HORIZONTAL);
  overflowToolbar.setFloatable(false);
  overflowToolbar.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));
}

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

popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
popupMenu.add(openXpTracker);
popupMenu.add(reset);

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

popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
popupMenu.add(favoriteMenuOption);

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

popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
popupMenu.add(reset);
overallPanel.setComponentPopupMenu(popupMenu);

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

popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
popupMenu.add(refresh);

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

popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
box.setComponentPopupMenu(popupMenu);

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

popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
slotContainer.setComponentPopupMenu(popupMenu);

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

@Override
  public void processDataBinding() {
    popup.setBorder(getPopupBorder());
  }
});

代码示例来源:origin: senbox-org/snap-desktop

public InputOptionsPanel(JTextArea parent) {
  popupMenu = new JPopupMenu();
  popupMenu.setOpaque(false);
  popupMenu.setBorder(null);
  textArea = parent;
}

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

@Override
  public void processDataBinding() {
    popup.setBorder(getPopupBorder());
  }
});

代码示例来源:origin: com.dorkbox/SystemTray

@Override
  public
  void installUI(final JComponent c) {
    super.installUI(c);
    JPopupMenu popupMenu = (JPopupMenu) c;
    // borderUI resource border type will get changed internally!
    // setBorder(new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0));
    popupMenu.setBorder(new EmptyBorder(1, 1, 1, 1));
  }
};

代码示例来源:origin: atarw/material-ui-swing

@Override
public void installUI (JComponent c) {
  super.installUI (c);
  JPopupMenu popupMenu = (JPopupMenu) c;
  popupMenu.setBorder (UIManager.getBorder ("PopupMenu.border"));
  popupMenu.setBackground (UIManager.getColor ("PopupMenu.background"));
  popupMenu.setForeground (UIManager.getColor ("PopupMenu.foreground"));
}

代码示例来源:origin: Exslims/MercuryTrade

public JPopupMenu getContextPanel() {
  JPopupMenu contextMenu = new JPopupMenu();
  contextMenu.setBackground(AppThemeColor.FRAME);
  contextMenu.setBorder(BorderFactory.createLineBorder(AppThemeColor.BORDER));
  contextMenu.setFont(REGULAR_FONT.deriveFont(scale * 16f));
  contextMenu.setForeground(AppThemeColor.TEXT_DEFAULT);
  return contextMenu;
}

代码示例来源:origin: net.sf.nimrod/nimrod-laf

public void installDefaults() {
 super.installDefaults();
 
 popupMenu.setBorder( NimRODBorders.getPopupMenuBorder());
 popupMenu.setOpaque( false);
}

代码示例来源: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);

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

private void $completeSetup() {
  allComponentsCreated = true;
  $JPanel0.add($JToolBar2);
  
  addChildrenToPopup();
  
  $JToolBar2.add(button, BorderLayout.CENTER);
  
  popup.setBorder((new TitledBorder(_("i18neditor.popup.title"))));
  button.setIcon((jaxx.runtime.Util.createActionIcon("numbereditor-calculator")));
  applyDataBinding("button.selected");
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

private void $completeSetup() {
  allComponentsCreated = true;
  $Table0.add($JToolBar2, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 17, 1, new Insets(0, 0, 0, 0), 0, 0));
  $Table0.add(combobox, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0));
  $Table0.add($JToolBar4, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, 13, 1, new Insets(0, 0, 0, 0), 0, 0));
  
  addChildrenToPopup();
  
  $JToolBar2.add($JButton3);
  
  
  $JToolBar4.add(changeDecorator);
  
  popup.setBorder((new TitledBorder(_("entitycombobox.popup.title"))));
  applyDataBinding("$JToolBar2.visible");
  $JButton3.setIcon((jaxx.runtime.Util.createActionIcon("combobox-reset")));
  applyDataBinding("$JButton3.enabled");
  applyDataBinding("combobox.editable");
  applyDataBinding("combobox.enabled");
  applyDataBinding("combobox.selectedItem");
  applyDataBinding("$JToolBar4.visible");
  changeDecorator.setIcon((jaxx.runtime.Util.createActionIcon("combobox-sort")));
}

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

jTextField2.addKeyListener(new java.awt.event.KeyAdapter() {
   public void keyReleased(java.awt.event.KeyEvent evt) {
     showPopup(evt);
   }
 });
void showPopup(java.awt.event.KeyEvent evt) {
   JPopupMenu popup = new JPopupMenu();
   popup.setLightWeightPopupEnabled(false);
   popup.setBorder(BorderFactory.createLineBorder(Color.black));
   popup.setLayout(new BorderLayout());
   popup.setSize(this.getPreferredSize());
   popup.setPreferredSize(this.getPreferredSize());
   popup.pack();
   popup.setOpaque(false);
   // create panel that contains the search result 
   popup.add(BorderLayout.CENTER, <YOUR PANEL WITH THE RESULT>);
   popup.setPreferredSize(new Dimension(jTextField2.getWidth(),250));
   <SEARCH PANEL>.setPreferredSize(new Dimension(jTextField2.getWidth(),250));
   popup.show(jTextField2, 0, jTextField2.getHeight());
  }

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

private void $completeSetup() {
  allComponentsCreated = true;
  addChildrenToContent();
  addChildrenToPopup();
  
  applyDataBinding("renderer.showIcon");
  applyDataBinding("renderer.showText");
  popup.setBorder((new TitledBorder(_("i18neditor.popup.title"))));
  applyDataBinding("button.icon");
  applyDataBinding("button.selected");
  applyDataBinding("button.text");
  applyDataBinding("button.toolTipText");
}

相关文章

JPopupMenu类方法