javax.swing.JMenuBar.getWidth()方法的使用及代码示例

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

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

JMenuBar.getWidth介绍

暂无

代码示例

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

@ScriptFunction(jsDoc = WIDTH_JSDOC)
@Override
public int getWidth() {
  return super.getWidth();
}

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

JMenuBar createCustomMenu() {
  final CardLayout layout = new CardLayout();
  final JMenuBar menu = new JMenuBar();
  menu.setLayout(layout);

  // Here you should create the normal, wide menu
  JComponent normalMenu = createNormalMenu();
  // Here you create the compressed, one button version
  JComponent compressedMenu = createCompressedMenu();

  menu.add(normalMenu, "normal");
  menu.add(compressedMenu, "compressed");

  menu.addComponentListener(new ComponentAdapter() {
    public void componentResized(ComponentEvent e) {
      if (menu.getPreferredSize().getWidth() > menu.getWidth()) {
        layout.show(menu, "compressed");
      } else {
        layout.show(menu, "normal");
      }
    }
  });

  return menu;
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/graph

titleX = menuBar.getX() + menuBar.getWidth() + 2;
titleW = (int)(  (r.x - titleX - 3)/ _modeManager.getZoomer().getZoom() + 0.5  );
title = getTitle(frame.getTitle(), fm, titleW);

代码示例来源:origin: com.jtattoo/JTattoo

iconWidth = menuBar.getWidth() + 5;

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

: (this.menuBar.getWidth() + 5);
xOffset += leftEnd;
if (icon != null)
    - this.menuBar.getWidth() - 5;

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

: (this.menuBar.getWidth() + 5);
leftEnd = Math.max(iconWidth, menuWidth);
xOffset += leftEnd;
menuWidth = (this.menuBar == null) ? 0 : this.menuBar.getWidth() + 5;
rightEnd = width - Math.max(iconWidth, menuWidth);
xOffset = rightEnd - 5;

代码示例来源:origin: com.jtattoo/JTattoo

int menuBarWidth = menuBar == null ? 0 : menuBar.getWidth();
titleWidth -= menuBarWidth + 4;
frameTitle = JTattooUtilities.getClippedText(frameTitle, fm, titleWidth);
int menuBarWidth = menuBar == null ? 0 : menuBar.getWidth();
titleWidth -= menuBarWidth + 4;
frameTitle = JTattooUtilities.getClippedText(frameTitle, fm, titleWidth);

相关文章