本文整理汇总了Java中javax.swing.JToolBar.setBackground方法的典型用法代码示例。如果您正苦于以下问题:Java JToolBar.setBackground方法的具体用法?Java JToolBar.setBackground怎么用?Java JToolBar.setBackground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JToolBar
的用法示例。
在下文中一共展示了JToolBar.setBackground方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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)
);
}
示例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;
}
示例3: PerspectivesPanelBar
import javax.swing.JToolBar; //导入方法依赖的package包/类
private PerspectivesPanelBar(Perspectives perspectives) {
setLayout(new GridBagLayout());
setOpaque(false);
GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = new Insets(1, 10, 2, 0);
JToolBar workspaceToolBar = perspectives.getWorkspaceToolBar();
workspaceToolBar.setBackground(getBackgroundColor());
add(workspaceToolBar, gbc);
}