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

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

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

JToolBar.setFont介绍

暂无

代码示例

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

代码示例来源: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: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public void setFont(Font aFont) {
  super.setFont(aFont);
}

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

@Override
public void installUI (JComponent c) {
  super.installUI (c);
  JToolBar toolBar = (JToolBar) c;
  toolBar.setFont (UIManager.getFont ("ToolBar.font"));
  toolBar.setBackground (UIManager.getColor ("ToolBar.background"));
  toolBar.setForeground (UIManager.getColor ("ToolBar.foreground"));
  toolBar.setBorder (UIManager.getBorder ("ToolBar.border"));
  this.dockingBorderColor = null;
  this.floatingBorderColor = null;
  this.dockingColor = UIManager.getColor ("ToolBar.dockingBackground");
  this.floatingColor = UIManager.getColor ("ToolBar.floatingBackground");
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

private void init() {
  this.searchField = new JTextField(30);
  searchField.setFont(FONT_SMALL);
  final JButton findButton = new JButton(JMeterUtils.getResString("search_text_button_find"));
  findButton.setFont(FONT_SMALL);
  findButton.setActionCommand(FIND_ACTION);
  findButton.addActionListener(this);
  regexCB = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_regexp"));
  regexCB.setFont(FONT_SMALL);
  matchCaseCB = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_case"));
  matchCaseCB.setFont(FONT_SMALL);
  this.toolBar = new JToolBar();
  toolBar.setFloatable(false);
  toolBar.setFont(FONT_SMALL);
  toolBar.add(searchField);
  toolBar.add(findButton);
  toolBar.add(matchCaseCB);
  toolBar.add(regexCB);
  searchField.addActionListener(e -> findButton.doClick(0));
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

this.toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.setFont(FONT_SMALL);
toolBar.add(textToFindField);

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

@ScriptFunction
@Override
public void setFont(Font aValue) {
  super.setFont(aValue);
  if (gapLabel != null) {
    gapLabel.setFont(aValue);
  }
  if (iconLabel != null) {
    iconLabel.setFont(aValue);
  }
  if (extraTools != null) {
    extraTools.setFont(aValue);
  }
  if (decorated != null) {
    decorated.setFont(aValue);
  }
  Font f = getFont();
  if (f != null && prefSizeCalculator != null) {
    prefSizeCalculator.setFont(f);
  }
}

相关文章

JToolBar类方法