本文整理汇总了Java中javax.swing.JToolBar.setLayout方法的典型用法代码示例。如果您正苦于以下问题:Java JToolBar.setLayout方法的具体用法?Java JToolBar.setLayout怎么用?Java JToolBar.setLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JToolBar
的用法示例。
在下文中一共展示了JToolBar.setLayout方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createToolbar
import javax.swing.JToolBar; //导入方法依赖的package包/类
private JToolBar createToolbar() {
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.setBorder(javax.swing.BorderFactory.createEtchedBorder());
toolBar.setLayout(new javax.swing.BoxLayout(toolBar, javax.swing.BoxLayout.X_AXIS));
JButton pull = Utils.createButton("Pull", TestExecutionUI.this);
pull.setToolTipText("Pull Selected TestCases to TestSet");
pull.setIcon(Utils.getIconByResourceName("/ui/resources/testExecution/pull"));
JButton export = Utils.createButton("Export", TestExecutionUI.this);
export.setToolTipText("Export Selected TestCases into Manual TestCases");
export.setIcon(Utils.getIconByResourceName("/ui/resources/testExecution/export"));
filterButton = Utils.createButton("Filter", TestExecutionUI.this);
filterButton.setToolTipText("Filter TestCases By Tags");
filterButton.setIcon(Utils.getIconByResourceName("/ui/resources/toolbar/tag"));
toolBar.add(pull);
toolBar.add(export);
toolBar.add(filterButton);
return toolBar;
}
示例2: 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);
}
示例3: initComponents
import javax.swing.JToolBar; //导入方法依赖的package包/类
protected void initComponents() {
multipleButtons = new ArrayList<JButton>();
controls = new JPanel(new BorderLayout());
statusLabel = new JLabel(""); //$NON-NLS-1$
statusLabel.setForeground(Color.BLUE);
slotPanel = new JPanel();
toolbar = new JToolBar();
toolbar.setFloatable(false);
toolbar.setLayout(new BoxLayout(toolbar, BoxLayout.Y_AXIS));
addRowButton = addButton(addRowButtonText);
multipleButtons.add(addRowButton);
addColumnButton = addButton(addColumnButtonText);
multipleButtons.add(addColumnButton);
clearButton = addButton(Resources.getString("BoardPicker.clear")); //$NON-NLS-1$
multipleButtons.add(clearButton);
setAllowMultiple(allowMultiple);
controls.add(BorderLayout.NORTH, statusLabel);
JPanel pp = new JPanel();
pp.add(toolbar);
controls.add(BorderLayout.WEST, pp);
slotScroll = new JScrollPane(slotPanel);
controls.add(BorderLayout.CENTER, slotScroll);
reset();
}
示例4: createToolBar
import javax.swing.JToolBar; //导入方法依赖的package包/类
private void createToolBar() {
searchBar = new JToolBar();
searchBar.setFloatable(false);
searchBar.setLayout(new BoxLayout(searchBar, BoxLayout.X_AXIS));
searchBar.setBorder(BorderFactory.createEtchedBorder());
JLabel searchLabel = new JLabel(Utils.getIconByResourceName("/ui/resources/search"));
searchField = new JTextField();
searchField.setActionCommand("SearchField");
searchField.addActionListener(this);
searchBar.add(searchLabel);
searchBar.add(new javax.swing.Box.Filler(new java.awt.Dimension(5, 0),
new java.awt.Dimension(5, 0),
new java.awt.Dimension(5, 32767)));
searchBar.add(searchField);
}
示例5: initComponents
import javax.swing.JToolBar; //导入方法依赖的package包/类
protected void initComponents() {
setLayout(new BorderLayout());
actionBar = new JToolBar();
actionBar.setOrientation(JToolBar.VERTICAL);
actionBar.setLayout(new BoxLayout(actionBar, BoxLayout.Y_AXIS));
actionBar.setFloatable(false);
fixSize(actionBar);
add(actionBar, BorderLayout.WEST);
// Make actionBar initially invisible. setButtons will make it visible
// if actions are defined.
// This will prevent 'blinking' of the toolbar (see IZ 233206)
actionBar.setVisible(false);
findBar = new FindBar(new FindBar.Owner() {
@Override
public void close(FindBar fb) {
findBar.getState().setVisible(false);
// OLD TerminalContainerImpl.super.remove(findBar);
componentRemove(findBar);
validate();
requestFocus();
}
});
}
示例6: MainPanel
import javax.swing.JToolBar; //导入方法依赖的package包/类
public MainPanel(Backend backend, Parameters params)
{
this.backend = backend;
fileList = new FileListPanel(backend);
fileList.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
toolBar = new JToolBar();
toolBar.setLayout(new ExpandLayout()
{
@Override
public Component createComponent(Action a)
{
return new JButton(a);
}
});
toolBar.setFloatable(false);
toolBar.setRollover(true);
setupActions(params);
setLayout(new BorderLayout());
add(toolBar, BorderLayout.NORTH);
add(fileList, BorderLayout.CENTER);
// TODO: Temporary
FileInfo root = new FileInfo();
root.setDirectory(true);
fileList.setCwd(root);
}
示例7: withToolbar
import javax.swing.JToolBar; //导入方法依赖的package包/类
private JToolBar withToolbar(JComponent a, JComponent b) {
JToolBar tbar = getToolbar();
tbar.add(a);
tbar.add(b);
tbar.setLayout(new BoxLayout(tbar, BoxLayout.LINE_AXIS));
return tbar;
}