本文整理了Java中javax.swing.JToolBar.setBackground()
方法的一些代码示例,展示了JToolBar.setBackground()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToolBar.setBackground()
方法的具体详情如下:
包路径:javax.swing.JToolBar
类名称:JToolBar
方法名:setBackground
暂无
代码示例来源:origin: magefree/mage
private void makeTransparent() {
this.addComponentListener(this);
setOpaque(false);
cardGrid.setOpaque(false);
cardSelectorScrollPane.setOpaque(false);
cardSelectorScrollPane.getViewport().setOpaque(false);
cbSortBy.setModel(new DefaultComboBoxModel<>(SortBy.values()));
cbSortBy.setSelectedItem(sortSetting.getSortBy());
jTextFieldSearch.addActionListener(searchAction);
// make the components more readable
tbColor.setBackground(new Color(250, 250, 250, 150));
tbColor.setOpaque(true); // false = transparent
tbTypes.setBackground(new Color(250, 250, 250, 150));
tbTypes.setOpaque(true); // false = transparent
cardSelectorBottomPanel.setBackground(new Color(250, 250, 250, 150));
cardSelectorBottomPanel.setOpaque(true); // false = transparent
}
代码示例来源:origin: jshiell/checkstyle-idea
progressPanel.add(Box.createHorizontalGlue());
progressPanel.setFloatable(false);
progressPanel.setBackground(UIManager.getColor("Panel.background"));
progressPanel.setBorder(null);
代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler
@Override
public void setBackground(Color bg) {
Object background = UIManager.get("MainToolBar.background");
if (background instanceof Color) {
super.setBackground((Color) background);
}
}
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setBackground(Color aValue) {
super.setBackground(aValue);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial
private void setAquaBackground() {
if( "Aqua".equals( UIManager.getLookAndFeel().getID() ) ) { // NOI18N
Color color = UIManager.getColor("NbExplorerView.background"); // NOI18N
setBackground(color);
controlsToolBar.setBackground(color);
jPanel2.setBackground(color);
jPanel4.setBackground(color);
jPanel5.setBackground(color);
treeSelectionPanel.setBackground(color);
}
}
代码示例来源:origin: org.gephi/desktop-statistics
private void initDesign() {
Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
toolbar.setBorder(b);
if (UIUtils.isAquaLookAndFeel()) {
toolbar.setBackground(UIManager.getColor("NbExplorerView.background"));
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial
private void aquaBackgroundWorkaround() {
if( "Aqua".equals( UIManager.getLookAndFeel().getID() ) ) { // NOI18N
Color color = UIManager.getColor("NbExplorerView.background"); // NOI18N
setBackground(color);
jToolBar1.setBackground(color);
resultsPanel.setBackground(color);
searchCriteriaPanel.setBackground(color);
criteria.setBackground(color);
}
}
代码示例来源:origin: org.gephi/desktop-preview
private void refresh() {
panel.removeAll();
loadModelManagedRenderers();
//Show renderers in inverse execution order to make it intuitive for users (last executed renderers remain on top of the image)
for (int i = renderersList.size()-1; i >=0; i--) {
JToolBar bar = new JToolBar();
bar.setFloatable(false);
if (UIUtils.isAquaLookAndFeel()) {
bar.setBackground(UIManager.getColor("NbExplorerView.background"));
}
bar.add(new MoveRendererButton(i, true));
bar.add(new MoveRendererButton(i, false));
bar.add(renderersList.get(i));
panel.add(bar, "wrap");
}
panel.updateUI();
}
代码示例来源: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.netbeans.modules/org-netbeans-modules-maven-repository
@Override
public JComponent getToolbarRepresentation() {
if (toolbar == null) {
toolbar = new JToolBar();
if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
toolbar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
}
toolbar.setFloatable(false);
Action[] a = new Action[1];
Action[] actions = getLookup().lookup(a.getClass());
Dimension space = new Dimension(3, 0);
toolbar.addSeparator(space);
for (Action act : actions) {
JButton btn = new JButton();
Actions.connect(btn, act);
toolbar.add(btn);
toolbar.addSeparator(space);
}
}
return toolbar;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-maven-repository
@Override
public JComponent getToolbarRepresentation() {
if (toolbar == null) {
toolbar = new JToolBar();
if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
toolbar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
}
toolbar.setFloatable(false);
Action[] a = new Action[1];
Action[] actions = getLookup().lookup(a.getClass());
Dimension space = new Dimension(3, 0);
toolbar.addSeparator(space);
for (Action act : actions) {
JButton btn = new JButton();
Actions.connect(btn, act);
toolbar.add(btn);
toolbar.addSeparator(space);
}
}
return toolbar;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-maven-repository
@Override
public JComponent getToolbarRepresentation() {
if (toolbar == null) {
toolbar = new JToolBar();
if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
toolbar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
}
toolbar.setFloatable(false);
if (includeToolbar) {
Action[] a = new Action[1];
Action[] actions = getLookup().lookup(a.getClass());
Dimension space = new Dimension(3, 0);
toolbar.addSeparator(space);
for (Action act : actions) {
JButton btn = new JButton();
Actions.connect(btn, act);
toolbar.add(btn);
toolbar.addSeparator(space);
}
}
}
return toolbar;
}
代码示例来源:origin: org.gephi/desktop-preview
/**
* Creates new form RendererManagerPanel
*/
public RendererManager() {
initComponents();
buildTooltip();
if (UIUtils.isAquaLookAndFeel()) {
panel.setBackground(UIManager.getColor("NbExplorerView.background"));
}
if (UIUtils.isAquaLookAndFeel()) {
toolBar.setBackground(UIManager.getColor("NbExplorerView.background"));
}
previewController = Lookup.getDefault().lookup(PreviewController.class);
Lookup.getDefault().lookup(PreviewUIController.class).addPropertyChangeListener(this);
panel.setLayout(new MigLayout("insets 3", "[pref!]"));
setup();
}
代码示例来源:origin: apache/batik
/**
* Creates a new JConfigurationPanel.
*/
public JConfigurationPanel() {
toolbar = new JToolBar();
toolbar.setFloatable(false);
toolbar.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
toolbar.add(new JToolBar.Separator(new Dimension(8, 8)));
if (Platform.isOSX || isMetalSteel()) {
toolbar.setBackground(new Color(0xf8, 0xf8, 0xf8));
}
toolbar.setOpaque(true);
panel = new JPanel();
layout = Platform.isOSX ? new ResizingCardLayout() : new CardLayout();
group = new ButtonGroup();
setLayout(new BorderLayout());
panel.setLayout(layout);
add(toolbar, BorderLayout.NORTH);
add(panel);
}
代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik
/**
* Creates a new JConfigurationPanel.
*/
public JConfigurationPanel() {
toolbar = new JToolBar();
toolbar.setFloatable(false);
toolbar.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
toolbar.add(new JToolBar.Separator(new Dimension(8, 8)));
if (Platform.isOSX || isMetalSteel()) {
toolbar.setBackground(new Color(0xf8, 0xf8, 0xf8));
}
toolbar.setOpaque(true);
panel = new JPanel();
layout = Platform.isOSX ? new ResizingCardLayout() : new CardLayout();
group = new ButtonGroup();
setLayout(new BorderLayout());
panel.setLayout(layout);
add(toolbar, BorderLayout.NORTH);
add(panel);
}
代码示例来源:origin: org.gephi/desktop-filters
public FiltersPanel() {
initComponents();
//Toolbar
Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
toolbar.setBorder(b);
if (UIUtils.isAquaLookAndFeel()) {
toolbar.setBackground(UIManager.getColor("NbExplorerView.background"));
setBackground(UIManager.getColor("NbExplorerView.background"));
}
//Components
queriesPanel = new QueriesPanel();
southPanel.add(queriesPanel, BorderLayout.CENTER);
filterPanelPanel = new FilterPanelPanel();
filtersUIPanel.add(filterPanelPanel);
initEvents();
}
代码示例来源:origin: stackoverflow.com
tb.setBackground(Color.GREEN);
ui = (BasicToolBarUI) tb.getUI();
代码示例来源:origin: org.gephi/desktop-datalab
controlToolbar.setBorder(b);
if (UIUtils.isAquaLookAndFeel()) {
controlToolbar.setBackground(UIManager.getColor("NbExplorerView.background"));
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial
/**
* Creates a new Synchronize Panel managed by the given versioning system.
*
* @param parent enclosing top component
*/
public VersioningPanel(HgVersioningTopComponent parent) {
this.parentTopComponent = parent;
this.mercurial = Mercurial.getInstance();
refreshViewTask = rp.create(new RefreshViewTask());
explorerManager = new ExplorerManager();
displayStatuses = FileInformation.STATUS_LOCAL_CHANGE;
noContentComponent.setLabel(NbBundle.getMessage(VersioningPanel.class, "MSG_No_Changes_All")); // NOI18N
syncTable = new SyncTable();
initComponents();
setVersioningComponent(syncTable.getComponent());
reScheduleRefresh(0);
// XXX click it in form editor, probbaly requires Mattisse >=v2
jPanel2.setFloatable(false);
jPanel2.putClientProperty("JToolBar.isRollover", Boolean.TRUE); // NOI18N
jPanel2.setLayout(new ToolbarLayout());
if( "Aqua".equals( UIManager.getLookAndFeel().getID() ) ) { // NOI18N
Color color = UIManager.getColor("NbExplorerView.background"); // NOI18N
setBackground(color);
jPanel2.setBackground(color);
}
}
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
painelRecuperados.setBorder(new LineBorder(ColorController.VERMELHO, 2));
labelRecuperados.setForeground(Color.BLACK);
botoesPlugin.setBackground(ColorController.FUNDO_BOTOES_EXPANSIVEIS);
botoesPlugin.setOpaque(true);
内容来源于网络,如有侵权,请联系作者删除!