本文整理汇总了Java中javax.swing.JToolBar.VERTICAL属性的典型用法代码示例。如果您正苦于以下问题:Java JToolBar.VERTICAL属性的具体用法?Java JToolBar.VERTICAL怎么用?Java JToolBar.VERTICAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.swing.JToolBar
的用法示例。
在下文中一共展示了JToolBar.VERTICAL属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initComponents
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: initToolBar
/**
* Initialize toolbar.
*/
private void initToolBar() {
toolbar = new JToolBar(JToolBar.VERTICAL);
toolbar.setFloatable(false);
add(toolbar, BorderLayout.WEST);
JButton button = makeButton("save", SAVE, "Save", "Save");
toolbar.add(button);
button = makeButton("print", PRINT, "Print", "Print");
toolbar.add(button);
}
示例3: initPanel
/**
* Called only from AWT
*/
private void initPanel() {
// configure toolbar
toolbar = new ToolbarWithOverflow(JToolBar.VERTICAL);
toolbar.setFloatable(false);
toolbar.setRollover(true);
toolbar.setBorderPainted(true);
toolbar.setBorder(
javax.swing.BorderFactory.createCompoundBorder(
javax.swing.BorderFactory.createMatteBorder(0, 1, 0, 0,
javax.swing.UIManager.getDefaults().getColor("Separator.foreground")), //NOI18N
javax.swing.BorderFactory.createEmptyBorder(0, 1, 0, 0)));
if ("Aqua".equals(UIManager.getLookAndFeel().getID())) { //NOI18N
toolbar.setBackground(UIManager.getColor("NbExplorerView.background"));
}
// toolbar.setFocusable(false);
// create toggle buttons
int filterCount = filtersDesc.getFilterCount();
toggles = new ArrayList<JToggleButton>(filterCount);
JToggleButton toggleButton;
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;
for (int i = 0; i < toggles.size(); i++) {
curToggle = toggles.get(i);
curToggle.addActionListener(this);
toolbar.add(curToggle);
}
// initialize member states map
synchronized (STATES_LOCK) {
filterStates = fStates;
}
}