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


Java JToolBar.setOpaque方法代码示例

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


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

示例3: addSwitchViewButton

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 * Adds the switchView button the the panel
 * 
 * @param gbc
 *          - the constraints used for this component
 */
private void addSwitchViewButton(GridBagConstraints gbc) {
	gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
			UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
	gbc.anchor = GridBagConstraints.EAST;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 2;
	gbc.gridy = 0;
	gbc.weightx = 0;
	gbc.weighty = 0;
	JToolBar toolbar = new JToolBar();
	switchViewButton = new ToolbarButton(null, false);
	switchViewButton.setToolTipText(translator.getTranslation(Tags.CHANGE_TREE_VIEW_BUTTON_TOOLTIP));
	URL resource = currentViewMode == ResourcesViewMode.FLAT_VIEW 
	    ? getClass().getResource(ImageConstants.TREE_VIEW)
	    : getClass().getResource(ImageConstants.TABLE_VIEW);
	if (resource != null) {
	  ImageIcon icon = (ImageIcon) imageUtilities.loadIcon(resource);
	  switchViewButton.setIcon(icon);
	}
	toolbar.add(switchViewButton);
	toolbar.setFloatable(false);
	toolbar.setOpaque(false);
	this.add(toolbar, gbc);

}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:32,代码来源:ChangesPanel.java

示例4: addBrowseButton

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 * Adds the browse button to the panel
 * 
 * @param gbc
 *          - the constraints used for this component
 * 
 */
private void addBrowseButton(GridBagConstraints gbc) {
	gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
			UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
	gbc.anchor = GridBagConstraints.WEST;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 2;
	gbc.gridy = 0;
	gbc.weightx = 0;
	gbc.weighty = 0;
	browseButton = new ToolbarButton(null, false);
	ImageUtilities imageUtilities = PluginWorkspaceProvider.getPluginWorkspace().getImageUtilities();
	URL resource = getClass().getResource(ImageConstants.FILE_CHOOSER_ICON);
	if (resource != null) {
	  ImageIcon icon = (ImageIcon) imageUtilities.loadIcon(resource);
	  browseButton.setIcon(icon);
	}
	browseButton.setToolTipText(translator.getTranslation(Tags.BROWSE_BUTTON_TOOLTIP));
	JToolBar browswtoolbar = new JToolBar();
	browswtoolbar.add(browseButton);
	browswtoolbar.setFloatable(false);
	browswtoolbar.setOpaque(false);
	this.add(browswtoolbar, gbc);
}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:31,代码来源:WorkingCopySelectionPanel.java

示例5: add

import javax.swing.JToolBar; //导入方法依赖的package包/类
@Override
public Component add(ProfilerToolbar toolbar, int index) {
    JToolBar implToolbar = ((Impl)toolbar).toolbar;
    implToolbar.setBorder(BorderFactory.createEmptyBorder());
    implToolbar.setOpaque(false);
    implToolbar.putClientProperty("Toolbar.noGTKBorder", Boolean.TRUE); // NOI18N
    return add(implToolbar, index);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ProfilerToolbar.java

示例6: createGUI

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 * Sets the panel layout and creates all the buttons with their functionality
 * making them visible
 */
public void createGUI() {
	gitToolbar = new JToolBar();
	gitToolbar.setOpaque(false);
	gitToolbar.setFloatable(false);
	this.setLayout(new GridBagLayout());
	this.pushesAhead = GitAccess.getInstance().getPushesAhead();
	this.pullsBehind = GitAccess.getInstance().getPullsBehind();

	GridBagConstraints gbc = new GridBagConstraints();
	gbc.insets = new Insets(0, 0, 0, 0);
	gbc.anchor = GridBagConstraints.WEST;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 0;
	gbc.gridy = 0;
	gbc.weightx = 0;
	gbc.weighty = 0;
	addCloneRepositoryButton();
	addPushAndPullButtons();
	addBranchSelectButton();
	addSubmoduleSelectButton();
	if (gitRepoHasSubmodules()) {
		submoduleSelectButton.setEnabled(true);
	} else {
		submoduleSelectButton.setEnabled(false);
	}
	this.add(gitToolbar, gbc);

	gbc.insets = new Insets(0, 0, 0, 0);
	gbc.anchor = GridBagConstraints.EAST;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 1;
	gbc.gridy = 0;
	gbc.weightx = 1;
	gbc.weighty = 0;
	updateStatus();
	this.add(statusInformationLabel, gbc);

	this.setMinimumSize(new Dimension(UIConstants.PANEL_WIDTH, UIConstants.TOOLBAR_PANEL_HEIGHT));
}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:44,代码来源:ToolbarPanel.java


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