本文整理汇总了Java中javax.swing.JToolBar.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java JToolBar.setBorder方法的具体用法?Java JToolBar.setBorder怎么用?Java JToolBar.setBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JToolBar
的用法示例。
在下文中一共展示了JToolBar.setBorder方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: initDecoration
import javax.swing.JToolBar; //导入方法依赖的package包/类
private void initDecoration() {
if (doc instanceof NbDocument.CustomToolbar) {
NbDocument.CustomToolbar ce = (NbDocument.CustomToolbar) doc;
JToolBar customToolbar;
provideUnfinishedPane = true;
try {
customToolbar = ce.createToolbar(pane);
} finally {
provideUnfinishedPane = false;
}
if (customToolbar == null) {
throw new IllegalStateException(
"Document:" + doc // NOI18N
+ " implementing NbDocument.CustomToolbar may not" // NOI18N
+ " return null toolbar"); // NOI18N
}
Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
customToolbar.setBorder(b);
editor.add(customToolbar, BorderLayout.NORTH);
}
}
示例3: 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);
}
示例4: ResultPanelTree
import javax.swing.JToolBar; //导入方法依赖的package包/类
ResultPanelTree(ResultDisplayHandler displayHandler, StatisticsPanel statPanel) {
super(new BorderLayout());
treeView = new ResultTreeView();
treeView.getAccessibleContext().setAccessibleName(Bundle.ACSN_TestResults());
treeView.getAccessibleContext().setAccessibleDescription(Bundle.ACSD_TestResults());
treeView.setBorder(BorderFactory.createEtchedBorder());
// resultBar.setPassedPercentage(0.0f);
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.add(resultBar);
toolBar.setBorder(BorderFactory.createEtchedBorder());
add(toolBar, BorderLayout.NORTH);
add(treeView, BorderLayout.CENTER);
explorerManager = new ExplorerManager();
explorerManager.setRootContext(rootNode = new RootNode(displayHandler.getSession(), filterMask));
explorerManager.addPropertyChangeListener(this);
initAccessibility();
this.displayHandler = displayHandler;
this.statPanel = statPanel;
displayHandler.setLookup(ExplorerUtils.createLookup(explorerManager, new ActionMap()));
}
示例5: 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)
);
}
示例6: 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;
}
示例7: 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);
}
示例8: getTreeInPanel
import javax.swing.JToolBar; //导入方法依赖的package包/类
private JPanel getTreeInPanel(String labelText, JTree tree) {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.setBorder(BorderFactory.createEtchedBorder());
JLabel label = new JLabel(labelText);
label.setFont(new Font("Default", Font.BOLD, 12));
toolBar.add(new javax.swing.Box.Filler(new java.awt.Dimension(10, 0),
new java.awt.Dimension(10, 0),
new java.awt.Dimension(10, 32767)));
toolBar.add(label);
toolBar.add(new javax.swing.Box.Filler(new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 0),
new java.awt.Dimension(32767, 32767)));
toolBar.add(getPrevoiusTestCaseButton());
toolBar.add(getEditTagButton());
toolBar.setPreferredSize(new java.awt.Dimension(toolBar.getPreferredSize().width, 30));
panel.add(toolBar, BorderLayout.NORTH);
panel.add(TreeSearch.installFor(tree), BorderLayout.CENTER);
return panel;
}
示例9: getRTreeInPanel
import javax.swing.JToolBar; //导入方法依赖的package包/类
private JPanel getRTreeInPanel(String labelText, JTree tree) {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.setBorder(BorderFactory.createEtchedBorder());
reusableSwitch = new JButton(labelText);
reusableSwitch.setFont(new Font("Default", Font.BOLD, 12));
reusableSwitch.setContentAreaFilled(false);
toolBar.add(new javax.swing.Box.Filler(new java.awt.Dimension(10, 0),
new java.awt.Dimension(10, 0),
new java.awt.Dimension(10, 32767)));
toolBar.add(reusableSwitch);
toolBar.setPreferredSize(new java.awt.Dimension(toolBar.getPreferredSize().width, 30));
panel.add(toolBar, BorderLayout.NORTH);
panel.add(TreeSearch.installFor(tree), BorderLayout.CENTER);
return panel;
}
示例10: getCompInPanel
import javax.swing.JToolBar; //导入方法依赖的package包/类
private JPanel getCompInPanel(String labelText, JComponent comp) {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.setBorder(BorderFactory.createEtchedBorder());
JLabel label = new JLabel(labelText);
label.setFont(new Font("Default", Font.BOLD, 12));
toolBar.add(new javax.swing.Box.Filler(new java.awt.Dimension(10, 0),
new java.awt.Dimension(10, 0),
new java.awt.Dimension(10, 32767)));
toolBar.add(label);
toolBar.setPreferredSize(new java.awt.Dimension(toolBar.getPreferredSize().width, 25));
panel.add(toolBar, BorderLayout.NORTH);
panel.add(comp, BorderLayout.CENTER);
return panel;
}
示例11: 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);
}
示例12: createActionsToolbar
import javax.swing.JToolBar; //导入方法依赖的package包/类
private static JToolBar createActionsToolbar() {
JToolBar jt = new JToolBar(JToolBar.HORIZONTAL);
jt.setBorder(new EmptyBorder(0, 0, 0, 0));
jt.setFloatable(false);
jt.setRollover(false);
return jt;
}
示例13: initView
import javax.swing.JToolBar; //导入方法依赖的package包/类
/** Initializes the GUI components of the viewer. */
private void initView() {
// the viewer's toolbar
JToolBar toolBar = new ExtendedJToolBar(true);
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Colors.TEXTFIELD_BORDER));
// add actions that clears all entries
Action clearAction = new ClearCacheAction(map);
toolBar.add(clearAction);
// setup the header column (reuse the layout of the entries)
JPanel headerPanel = new JPanel(IOObjectCacheEntryPanel.ENTRY_LAYOUT);
headerPanel.add(Box.createVerticalStrut(16), IOObjectCacheEntryPanel.ICON_CONSTRAINTS);
JLabel typeLabel = new JLabel(I18N.getGUILabel("ioobject_viewer.type"));
typeLabel.setFont(getFont().deriveFont(Font.ITALIC));
headerPanel.add(typeLabel, IOObjectCacheEntryPanel.TYPE_CONSTRAINTS);
JLabel keyLabel = new JLabel(I18N.getGUILabel("ioobject_viewer.key"));
keyLabel.setFont(getFont().deriveFont(Font.ITALIC));
headerPanel.add(keyLabel, IOObjectCacheEntryPanel.KEY_CONSTRAINTS);
headerPanel.add(Box.createVerticalStrut(24), IOObjectCacheEntryPanel.REMOVE_BUTTON_CONSTRAINTS);
// create entries panel and embed in scroll pane
scrollPane = new ExtendedJScrollPane(createEntriesPanel());
scrollPane.setBorder(null);
// panel containing the header row and the actual entries
JPanel contentPanel = new JPanel(new BorderLayout());
contentPanel.add(headerPanel, BorderLayout.NORTH);
contentPanel.add(scrollPane, BorderLayout.CENTER);
// put everything together
add(toolBar, BorderLayout.NORTH);
add(contentPanel, BorderLayout.CENTER);
}
示例14: XMLEditor
import javax.swing.JToolBar; //导入方法依赖的package包/类
public XMLEditor(MainFrame mainFrame) {
super(new BorderLayout());
this.mainFrame = mainFrame;
// create text area
this.editor = new RSyntaxTextArea(new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_XML));
this.editor.setAnimateBracketMatching(true);
this.editor.setAutoIndentEnabled(true);
this.editor.setSelectionColor(Colors.TEXT_HIGHLIGHT_BACKGROUND);
this.editor.setBorder(null);
JToolBar toolBar = new ExtendedJToolBar();
toolBar.setBorder(null);
toolBar.add(new ResourceAction(true, "xml_editor.apply_changes") {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent e) {
try {
validateProcess();
} catch (IOException | XMLException e1) {
LogService.getRoot().log(Level.WARNING,
"com.rapidminer.gui.processeditor.XMLEditor.failed_to_parse_process");
}
}
});
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Colors.TEXTFIELD_BORDER));
add(toolBar, BorderLayout.NORTH);
RTextScrollPane rTextScrollPane = new RTextScrollPane(editor);
rTextScrollPane.setBorder(null);
add(rTextScrollPane, BorderLayout.CENTER);
}