javax.swing.JMenu.setOpaque()方法的使用及代码示例

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

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

JMenu.setOpaque介绍

暂无

代码示例

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

@ScriptFunction
@Override
public void setOpaque(boolean aValue) {
  super.setOpaque(aValue);
}

代码示例来源:origin: org.java.net.substance/substance

/**
 * Returns the <code>JMenu</code> displaying the appropriate menu items for
 * manipulating the Frame.
 * 
 * @return <code>JMenu</code> displaying the appropriate menu items for
 *         manipulating the Frame.
 */
private JMenu createMenu() {
  JMenu menu = new JMenu("");
  menu.setOpaque(false);
  menu.setBackground(null);
  if (this.getWindowDecorationStyle() == JRootPane.FRAME) {
    this.addMenuItems(menu);
  }
  return menu;
}

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

@Override
public void installUI (JComponent c) {
  super.installUI (c);
  JMenu menu = (JMenu) c;
  menu.setFont (UIManager.getFont ("Menu.font"));
  menu.setBorder (UIManager.getBorder ("Menu.border"));
  menu.setBackground (UIManager.getColor ("Menu.background"));
  menu.setForeground (UIManager.getColor ("Menu.foreground"));
  menu.setOpaque (UIManager.getBoolean ("Menu.opaque"));
}

代码示例来源:origin: com.github.insubstantial/substance

/**
 * Returns the <code>JMenu</code> displaying the appropriate menu items for
 * manipulating the Frame.
 *
 * @return <code>JMenu</code> displaying the appropriate menu items for
 *         manipulating the Frame.
 */
private JMenu createMenu() {
  JMenu menu = new JMenu("");
  menu.setOpaque(false);
  menu.setBackground(null);
  //if (this.getWindowDecorationStyle() == JRootPane.FRAME) {
    this.addMenuItems(menu);
  //}
  menu.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      if (e.getClickCount() > 1) {
        closeAction.actionPerformed(new ActionEvent(e.getSource(),
            ActionEvent.ACTION_PERFORMED, null,
            EventQueue.getMostRecentEventTime(), e.getModifiers()));
      }
    }
  });
  return menu;
}

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

public void update( Graphics g, JComponent c) {
 JMenu menu = (JMenu)c;
 if ( menu.isTopLevelMenu() ) {
  menu.setOpaque( false);
  
  ButtonModel model = menu.getModel();
  if ( model.isArmed() || model.isSelected() ) {
   g.setColor( NimRODLookAndFeel.getFocusColor());
   g.fillRoundRect( 1,1, c.getWidth()-2, c.getHeight()-3, 2,2);
  }
 }
 else {
  menuItem.setBorderPainted( false);
  menuItem.setOpaque( false);
 }
 
 super.update( g, c);
}

相关文章