javax.swing.JToolBar.setMinimumSize()方法的使用及代码示例

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

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

JToolBar.setMinimumSize介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

mageToolbar.setFont(new java.awt.Font("Segoe UI", 0, 48)); // NOI18N
mageToolbar.setMaximumSize(new java.awt.Dimension(614, 60));
mageToolbar.setMinimumSize(new java.awt.Dimension(566, 60));
mageToolbar.setPreferredSize(new java.awt.Dimension(614, 60));

代码示例来源:origin: magefree/mage

private void setGUISize() {
    Font font = GUISizeHelper.menuFont;
    mageToolbar.setFont(font);
    int newHeight = font.getSize() + 6;
    Dimension mageToolbarDimension = mageToolbar.getPreferredSize();
    mageToolbarDimension.height = newHeight + 6;
    mageToolbar.setMinimumSize(mageToolbarDimension);
    mageToolbar.setMaximumSize(mageToolbarDimension);
    mageToolbar.setPreferredSize(mageToolbarDimension);
    for (Component component : mageToolbar.getComponents()) {
      if (component instanceof JButton || component instanceof JLabel || component instanceof JToggleButton) {
        component.setFont(font);
        Dimension d = component.getPreferredSize();
        d.height = newHeight;
        component.setMinimumSize(d);
        component.setMaximumSize(d);

      }
      if (component instanceof javax.swing.JToolBar.Separator) {
        Dimension d = component.getPreferredSize();
        d.height = newHeight;
        component.setMinimumSize(d);
        component.setMaximumSize(d);
      }
    }
    balloonTip.setFont(GUISizeHelper.balloonTooltipFont);

    addTooltipContainer();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-terminal-nb

private void fixSize(JToolBar actionBar) {
  Insets ins = actionBar.getMargin();
  JButton dummy = new JButton();
  dummy.setBorderPainted(false);
  dummy.setOpaque(false);
  dummy.setText(null);
  dummy.setIcon(new Icon() {
  @Override
    public int getIconHeight() {
      return 16;
    }
  @Override
    public int getIconWidth() {
      return 16;
    }
    @SuppressWarnings(value = "empty-statement")
  @Override
    public void paintIcon(Component c, Graphics g, int x, int y) {
      ;
    }
  });
  actionBar.add(dummy);
  Dimension buttonPref = dummy.getPreferredSize();
  Dimension minDim = new Dimension(buttonPref.width + ins.left + ins.right, buttonPref.height + ins.top + ins.bottom);
  actionBar.setMinimumSize(minDim);
  actionBar.setPreferredSize(minDim);
  actionBar.remove(dummy);
}

代码示例来源:origin: vasl-developers/vasl

m_objToolbar.setRollover(true);
m_objToolbar.setMaximumSize(new Dimension(64, 23));
m_objToolbar.setMinimumSize(new Dimension(50, 23));
m_objToolbar.setPreferredSize(new Dimension(50, 23));

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

barPanel.setMinimumSize(new Dimension(75, 30));
barPanel.setBorder(BorderFactory.createEmptyBorder());
barPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor

toolBar.setBorderPainted(false);
toolBar.setMaximumSize(new java.awt.Dimension(74, 26));
toolBar.setMinimumSize(new java.awt.Dimension(74, 26));
toolBar.setOpaque(false);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation

toolBar.setBorderPainted(false);
toolBar.setMaximumSize(new java.awt.Dimension(74, 26));
toolBar.setMinimumSize(new java.awt.Dimension(74, 26));
toolBar.setOpaque(false);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation

toolBar.setRollover(true);
toolBar.setMaximumSize(new java.awt.Dimension(182, 26));
toolBar.setMinimumSize(new java.awt.Dimension(182, 26));
toolBar.setOpaque(false);
toolBar.setPreferredSize(new java.awt.Dimension(182, 26));

相关文章

JToolBar类方法