当前位置: 首页>>代码示例>>Java>>正文


Java JToolBar.setBorderPainted方法代码示例

本文整理汇总了Java中javax.swing.JToolBar.setBorderPainted方法的典型用法代码示例。如果您正苦于以下问题:Java JToolBar.setBorderPainted方法的具体用法?Java JToolBar.setBorderPainted怎么用?Java JToolBar.setBorderPainted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JToolBar的用法示例。


在下文中一共展示了JToolBar.setBorderPainted方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MainToolBar

import javax.swing.JToolBar; //导入方法依赖的package包/类
MainToolBar(@NonNull final Pair<JComponent,GridBagConstraints>... components) {
    super(BoxLayout.X_AXIS);
    setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 5));
    final JToolBar toolbar = new NoBorderToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setBorder(BorderFactory.createEmptyBorder());
    toolbar.setOpaque(false);
    toolbar.setFocusable(false);
    toolbar.setLayout(new GridBagLayout());
    for (Pair<JComponent,GridBagConstraints> p : components) {
        toolbar.add(p.first(),p.second());
    }
    add (toolbar);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:HierarchyTopComponent.java

示例2: initComponents

import javax.swing.JToolBar; //导入方法依赖的package包/类
private void initComponents() {
    setLayout (new BorderLayout ());
    contentComponent = new javax.swing.JPanel(new BorderLayout ());
    add (contentComponent, BorderLayout.CENTER);  //NOI18N
    JToolBar toolBar = new JToolBar(JToolBar.VERTICAL);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    toolBar.setBorderPainted(true);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolBar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    toolBar.setBorder(javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.background")),
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.foreground"))));
    add(toolBar, BorderLayout.WEST);
    JComponent buttonsPane = toolBar;
    viewModelListener = new ViewModelListener (
        name,
        contentComponent,
        buttonsPane,
        propertiesHelpID,
        ImageUtilities.loadImage(icon)
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ViewComponent.java

示例3: createFilterToolBar

import javax.swing.JToolBar; //导入方法依赖的package包/类
private JToolBar createFilterToolBar() {
    final FiltersDescriptor filtersDesc = FiltersDescriptor.getInstance();
    // configure toolbar
    final JToolBar toolbar = new NoBorderToolBar();
    toolbar.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
    toolbar.setFloatable(false);
    //toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setOpaque(false);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolbar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    createFilterToolBarUI(toolbar, filtersDesc);
    filtersDesc.addPropertyChangeListener(new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    createFilterToolBarUI(toolbar, filtersDesc);
                }
            });
        }
    });
    return toolbar;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:InfoPanel.java

示例4: initPanel

import javax.swing.JToolBar; //导入方法依赖的package包/类
/** Called only from AWT */
private void initPanel () {
    setBorder(new EmptyBorder(1, 2, 3, 5));

    // configure toolbar
    JToolBar toolbar = new JToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    // create toggle buttons
    int filterCount = filtersDesc.getFilterCount();
    toggles = new ArrayList<JToggleButton>(filterCount);
    JToggleButton toggleButton = null;
    
    Map<String,Boolean> fStates = new HashMap<String, Boolean>(filterCount * 2);

    for (int i = 0; i < filterCount; i++) {
        toggleButton = createToggle(fStates, i);
        toggles.add(toggleButton);
    }
    
    // add toggle buttons
    JToggleButton curToggle;
    Dimension space = new Dimension(3, 0);
    for (int i = 0; i < toggles.size(); i++) {
        curToggle = toggles.get(i);
        curToggle.addActionListener(this);
        toolbar.add(curToggle);
        if (i != toggles.size() - 1) {
            toolbar.addSeparator(space);
        }
    }
    
    add(toolbar);
    
    // initialize member states map
    synchronized (STATES_LOCK) {
        filterStates = fStates;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:FiltersManager.java

示例5: getToolBar

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 *
 * @return - the tool bar object
 */
JToolBar getToolBar() {
    JToolBar p = new JToolBar();
    p.setFloatable(false);
    p.setBorderPainted(false);
    return p;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:11,代码来源:ReportDefect.java

示例6: getToolbar

import javax.swing.JToolBar; //导入方法依赖的package包/类
private JToolBar getToolbar() {
    JToolBar tbar = new javax.swing.JToolBar();
    tbar.setFloatable(false);
    tbar.setRollover(true);
    tbar.setBorderPainted(false);
    return tbar;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:8,代码来源:JSList.java

示例7: setupInstance

import javax.swing.JToolBar; //导入方法依赖的package包/类
protected void setupInstance(JToolBar instance) {
    super.setupInstance(instance);
    
    instance.setBorderPainted(paintBorder);
    
    if (margin != null) instance.setMargin(margin.createInstance());
    
    instance.setFloatable(floatable);
    instance.setOrientation(orientation);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:JComponentBuilders.java


注:本文中的javax.swing.JToolBar.setBorderPainted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。