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

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

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

JToolBar.setPreferredSize介绍

暂无

代码示例

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

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

tbTypes.setRollover(true);
tbTypes.setToolTipText("Hold the ALT-key while clicking to deselect all other card types or hold the CTRL-key to only select all other card types."); // NOI18N
tbTypes.setPreferredSize(new java.awt.Dimension(732, 27));

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

private void replaceVerticalSplitPane(JComponent replacement) {
  removeAll();
  splitPane = null;
  setLayout(new BorderLayout());
  controlsToolBar.setPreferredSize(new Dimension(Short.MAX_VALUE, 25));
  add(controlsToolBar, BorderLayout.NORTH);
  add(replacement, BorderLayout.CENTER);
}

代码示例来源:origin: org.zaproxy/zap

private JToolBar getPanelToolbar() {
  if (panelToolbar == null) {
    panelToolbar = new javax.swing.JToolBar();
    panelToolbar.setLayout(new GridBagLayout());
    panelToolbar.setEnabled(true);
    panelToolbar.setFloatable(false);
    panelToolbar.setRollover(true);
    panelToolbar.setPreferredSize(new java.awt.Dimension(800, 30));
    panelToolbar.setName(panelPrefix + ".toolbar");
    setupToolbarElements(panelToolbar);
  }
  return panelToolbar;
}

代码示例来源:origin: org.zaproxy/zap

private javax.swing.JToolBar getPanelToolbar() {
  if (panelToolbar == null) {
    
    panelToolbar = new javax.swing.JToolBar();
    panelToolbar.setEnabled(true);
    panelToolbar.setFloatable(false);
    panelToolbar.setRollover(true);
    panelToolbar.setPreferredSize(new java.awt.Dimension(800,30));
    panelToolbar.setName("AlertToolbar");
    
    panelToolbar.add(getScopeButton());
    panelToolbar.add(getLinkWithSitesTreeButton());
    panelToolbar.addSeparator();
    panelToolbar.add(getEditButton());
  }
  return panelToolbar;
}

代码示例来源:origin: org.zaproxy/zap

panelToolbar.setFloatable(false);
panelToolbar.setRollover(true);
panelToolbar.setPreferredSize(new java.awt.Dimension(800,30));
panelToolbar.setName("ParamsToolbar");

代码示例来源:origin: org.zaproxy/zap

panelToolbar.setFloatable(false);
panelToolbar.setRollover(true);
panelToolbar.setPreferredSize(new java.awt.Dimension(800, 30));
panelToolbar.setName("HttpSessionToolbar");

代码示例来源:origin: AnimeshShaw/ChromeForensics

toolBar.setOrientation(JToolBar.HORIZONTAL);
toolBar.setFloatable(false);
toolBar.setPreferredSize(new Dimension(getWidth(), 40));

代码示例来源:origin: org.zaproxy/zap

panelToolbar.setFloatable(false);
panelToolbar.setRollover(true);
panelToolbar.setPreferredSize(new java.awt.Dimension(800,30));
panelToolbar.setName("History Toolbar");

代码示例来源: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: UNIVALI-LITE/Portugol-Studio

barraFerramentas.setRollover(true);
barraFerramentas.setOpaque(false);
barraFerramentas.setPreferredSize(new java.awt.Dimension(25, 25));
barraFerramentas.add(alinhador);

代码示例来源:origin: org.zaproxy/zap

private javax.swing.JToolBar getPanelToolbar() {
  if (panelToolbar == null) {
    
    panelToolbar = new javax.swing.JToolBar();
    panelToolbar.setLayout(new GridBagLayout());
    panelToolbar.setEnabled(true);
    panelToolbar.setFloatable(false);
    panelToolbar.setRollover(true);
    panelToolbar.setPreferredSize(new Dimension(800,30));
    panelToolbar.setName("ScriptsListToolbar");
    
    int i = 1;
    panelToolbar.add(getScopeButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    panelToolbar.add(getCreateContextButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    panelToolbar.add(getImportContextButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    panelToolbar.add(getExportContextButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    
    // TODO Disabled for now due to problems with scrolling with sparcely populated filtered trees
    //panelToolbar.add(getFilterButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    //panelToolbar.add(getFilterStatus(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    panelToolbar.add(new JLabel(), LayoutHelper.getGBC(20, 0, 1, 1.0D));	// spacer
  }
  return panelToolbar;
}

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

barraFerramentas.setRollover(true);
barraFerramentas.setOpaque(false);
barraFerramentas.setPreferredSize(new java.awt.Dimension(50, 25));
barraFerramentas.add(alinhador);

代码示例来源:origin: org.zaproxy/zap

t1.setPreferredSize(new java.awt.Dimension(80000,25));
t1.setMaximumSize(new java.awt.Dimension(80000,25));

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

jToolBar1.setRollover(true);
jToolBar1.setMaximumSize(new java.awt.Dimension(28, 240));
jToolBar1.setPreferredSize(new java.awt.Dimension(28, 240));

代码示例来源:origin: org.zaproxy/zap

panelToolbar.setFloatable(false);
panelToolbar.setRollover(true);
panelToolbar.setPreferredSize(new java.awt.Dimension(800,30));
panelToolbar.setName("Search Toolbar");

代码示例来源:origin: org.zaproxy/zap

panelToolbar.setFloatable(false);
panelToolbar.setRollover(true);
panelToolbar.setPreferredSize(new java.awt.Dimension(800,30));
panelToolbar.setName(prefix + ".toolbar");

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

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

代码示例来源:origin: org.zaproxy/zap

panelToolbar.setFloatable(false);
panelToolbar.setRollover(true);
panelToolbar.setPreferredSize(new java.awt.Dimension(800,30));
panelToolbar.setName(prefix + ".toolbar");

相关文章

JToolBar类方法