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

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

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

JMenuBar.getHeight介绍

暂无

代码示例

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

@ScriptFunction(jsDoc = HEIGHT_JSDOC)
@Override
public int getHeight() {
  return super.getHeight();
}

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

@Override
public void setDisplayMinimumSize(int width, int height) {
  Dimension dim = getDimensionFromDisplay(width, height);
  dim.height += mainToolBar.getHeight();
  dim.height += MenuBar.getHeight();
  setMinimumSize(dim);
}

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

public int getJMenuBarExtraHeight() {
  JMenuBar jMenuBar = getRootPane().getJMenuBar();
  if (jMenuBar != null && jMenuBar.isVisible())
    return jMenuBar.getHeight();
  return 0;
}

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

protected boolean isToolBarUnderMenubar() {
  if (toolBar != null && toolBar.getOrientation() == JToolBar.HORIZONTAL) {
    JRootPane rp = SwingUtilities.getRootPane(toolBar);
    JMenuBar mb = rp.getJMenuBar();
    if (mb != null) {
      Point mbPoint = new Point(0, 0);
      mbPoint = SwingUtilities.convertPoint(mb, mbPoint, rp);
      Point tbPoint = new Point(0, 0);
      tbPoint = SwingUtilities.convertPoint(toolBar, tbPoint, rp);
      tbPoint.y -= mb.getHeight() - 1;
      Rectangle rect = new Rectangle(mbPoint, mb.getSize());
      return rect.contains(tbPoint);
    }
  }
  return false;
}

代码示例来源:origin: omegat-org/omegat

private Rectangle calculateBounds(Component overlayComponent) {
  JRootPane rootPane = SwingUtilities.getRootPane(overlayComponent);
  Rectangle rect = SwingUtilities.convertRectangle(overlayComponent.getParent(),
      overlayComponent.getBounds(),
      rootPane.getContentPane());
  JMenuBar menuBar = rootPane.getJMenuBar();
  rect.x += MARGIN;
  rect.y += MARGIN + (menuBar == null ? 0 : menuBar.getHeight());
  rect.width -= MARGIN * 2;
  rect.height -= MARGIN * 2;
  return rect;
}

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

titleHeight += mb.getHeight();

代码示例来源:origin: com.googlecode.princeton-java-introduction/stdlib

public static void fullscreen () {
  frame.setResizable(true);
  frame.setExtendedState(Frame.MAXIMIZED_BOTH);
  int w = frame.getSize().width;
  int h = frame.getSize().height;
  //int w = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  //int h = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  int borderY = frame.getInsets().top + frame.getInsets().bottom;
  int borderX = frame.getInsets().left + frame.getInsets().right;
  setCanvasSize(w - borderX, h - borderY - menuBar.getHeight(), true);
  frame.setExtendedState(Frame.MAXIMIZED_BOTH);
}

代码示例来源:origin: com.github.fracpete/princeton-java-stdlib

public static void fullscreen () {
  frame.setResizable(true);
  frame.setExtendedState(Frame.MAXIMIZED_BOTH);
  int w = frame.getSize().width;
  int h = frame.getSize().height;
  //int w = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  //int h = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  int borderY = frame.getInsets().top + frame.getInsets().bottom;
  int borderX = frame.getInsets().left + frame.getInsets().right;
  setCanvasSize(w - borderX, h - borderY - menuBar.getHeight(), true);
  frame.setExtendedState(Frame.MAXIMIZED_BOTH);
}

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

label.getX() + label.getWidth() + 3,
    (jMenuBar != null ? jMenuBar.getHeight() : 0) +
    containerRect.y +
    label.getY() +
    (descriptor.getToolBar(LEFT).getSize()),
    (jMenuBar != null ? jMenuBar.getHeight() : 0) +
    containerRect.y +
    label.getY() + label.getHeight() + 3
);
break;
    containerRect.y +
    containerRect.height -
                 previewPanel.getHeight() - 26
);
break;
    (jMenuBar != null ? jMenuBar.getHeight() : 0) +
    containerRect.y +
    label.getY() +
  (jMenuBar != null ? jMenuBar.getHeight() : 0) +
  containerRect.y +
  containerRect.height -

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

r.height = 5;
int diffMenu = (menuBar != null) ? menuBar.getHeight() : 0;

相关文章