本文整理了Java中javax.swing.JToolBar.add()
方法的一些代码示例,展示了JToolBar.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToolBar.add()
方法的具体详情如下:
包路径:javax.swing.JToolBar
类名称:JToolBar
方法名:add
暂无
代码示例来源:origin: org.netbeans.api/org-openide-util
/** Create the default toolbar representation of an array of actions.
* Null items in the array will add a separator to the toolbar.
*
* @param actions actions to show in the generated toolbar
* @return a toolbar instance displaying them
*/
public static JToolBar createToolbarPresenter(SystemAction[] actions) {
JToolBar p = new JToolBar();
for (SystemAction action : actions) {
if (action == null) {
p.addSeparator();
} else if (action instanceof Presenter.Toolbar) {
p.add(((Presenter.Toolbar) action).getToolbarPresenter());
}
}
return p;
}
代码示例来源:origin: stanfordnlp/CoreNLP
private void buildTagPanel() {
if (tagPanel == null) {
tagPanel = new JToolBar(SwingConstants.VERTICAL);
tagPanel.setFloatable(false);
frame.getContentPane().add(tagPanel, BorderLayout.EAST);
} else {
tagPanel.removeAll();
}
if (classifier != null) {
makeTagMaps();
Set<String> tags = classifier.labels();
String backgroundSymbol = classifier.backgroundSymbol();
for (String tag : tags) {
if (backgroundSymbol.equals(tag)) { continue; }
Color color = tagToColorMap.get(tag);
JButton b = new JButton(tag, new ColorIcon(color));
tagPanel.add(b);
}
}
tagPanel.revalidate();
tagPanel.repaint();
}
代码示例来源:origin: stanfordnlp/CoreNLP
private void buildTagPanel() {
if (tagPanel == null) {
tagPanel = new JToolBar(SwingConstants.VERTICAL);
tagPanel.setFloatable(false);
frame.getContentPane().add(tagPanel, BorderLayout.EAST);
} else {
tagPanel.removeAll();
}
if (classifier != null) {
makeTagMaps();
Set<String> tags = classifier.labels();
String backgroundSymbol = classifier.backgroundSymbol();
for (String tag : tags) {
if (backgroundSymbol.equals(tag)) { continue; }
Color color = tagToColorMap.get(tag);
JButton b = new JButton(tag, new ColorIcon(color));
tagPanel.add(b);
}
}
tagPanel.revalidate();
tagPanel.repaint();
}
代码示例来源:origin: log4j/log4j
protected JToolBar createToolBar() {
JToolBar tb = new JToolBar();
tb.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
JComboBox fontCombo = new JComboBox();
tb.add(new JLabel(" Font: "));
tb.add(fontCombo);
tb.add(fontSizeCombo);
tb.addSeparator();
tb.addSeparator();
tb.add(newButton);
代码示例来源:origin: stackoverflow.com
JToolBar toolBar = new JToolBar(JToolBar.VERTICAL);
JLabel label = new JLabel(" ", JLabel.CENTER);
for (File f : files) {
RecentFile rf = new RecentFile(f, label);
menu.add(new JMenuItem(rf.getAction()));
toolBar.add(rf.getAction());
代码示例来源:origin: skylot/jadx
updateLink.setVisible(false);
JToolBar toolbar = new JToolBar();
toolbar.setFloatable(false);
toolbar.add(openAction);
toolbar.add(saveAllAction);
toolbar.add(exportAction);
toolbar.addSeparator();
toolbar.add(syncAction);
toolbar.add(flatPkgButton);
toolbar.addSeparator();
toolbar.add(textSearchAction);
toolbar.add(clsSearchAction);
toolbar.addSeparator();
toolbar.add(backAction);
toolbar.add(forwardAction);
toolbar.addSeparator();
toolbar.add(deobfToggleBtn);
toolbar.addSeparator();
toolbar.add(logAction);
toolbar.addSeparator();
toolbar.add(prefsAction);
toolbar.addSeparator();
toolbar.add(Box.createHorizontalGlue());
toolbar.add(updateLink);
代码示例来源:origin: 4thline/cling
JToolBar resourceToolBar = new JToolBar();
resourceToolBar.setFloatable(false);
resourceToolBar.add(playButton);
resourceToolBar.add(copyURIButton);
resourceToolBar.add(copyProtocolInfoButton);
代码示例来源:origin: org.netbeans.api/org-openide-util-ui
/** Create the default toolbar representation of an array of actions.
* Null items in the array will add a separator to the toolbar.
*
* @param actions actions to show in the generated toolbar
* @return a toolbar instance displaying them
*/
public static JToolBar createToolbarPresenter(SystemAction[] actions) {
JToolBar p = new JToolBar();
for (SystemAction action : actions) {
if (action == null) {
p.addSeparator();
} else if (action instanceof Presenter.Toolbar) {
p.add(((Presenter.Toolbar) action).getToolbarPresenter());
}
}
return p;
}
代码示例来源:origin: bobbylight/RSyntaxTextArea
JToolBar toolBar = new JToolBar();
searchField = new JTextField(30);
toolBar.add(searchField);
final JButton nextButton = new JButton("Find Next");
nextButton.setActionCommand("FindNext");
nextButton.addActionListener(this);
toolBar.add(nextButton);
searchField.addActionListener(new ActionListener() {
@Override
prevButton.setActionCommand("FindPrev");
prevButton.addActionListener(this);
toolBar.add(prevButton);
regexCB = new JCheckBox("Regex");
toolBar.add(regexCB);
matchCaseCB = new JCheckBox("Match Case");
toolBar.add(matchCaseCB);
cp.add(toolBar, BorderLayout.NORTH);
代码示例来源:origin: jshiell/checkstyle-idea
progressBar.setMaximumSize(progressBarSize);
progressPanel = new JToolBar(JToolBar.HORIZONTAL);
progressPanel.add(Box.createHorizontalStrut(4));
progressPanel.add(new JLabel(message("plugin.toolwindow.override")));
progressPanel.add(Box.createHorizontalStrut(4));
progressPanel.add(configurationOverrideCombo);
progressPanel.add(Box.createHorizontalStrut(4));
progressPanel.addSeparator();
progressPanel.add(Box.createHorizontalStrut(4));
progressPanel.add(progressLabel);
progressPanel.add(Box.createHorizontalGlue());
progressPanel.setFloatable(false);
progressPanel.setBackground(UIManager.getColor("Panel.background"));
代码示例来源:origin: magefree/mage
jToolBar1 = new javax.swing.JToolBar();
btnConnect = new javax.swing.JButton();
btnSendMessage = new javax.swing.JButton();
btnConnect.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnConnect.addActionListener(evt -> btnConnectActionPerformed(evt));
jToolBar1.add(btnConnect);
btnSendMessage.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnSendMessage.addActionListener(evt -> btnSendMessageActionPerformed(evt));
jToolBar1.add(btnSendMessage);
jToolBar1.add(Box.createHorizontalGlue());
jToolBar1.add(lblStatus);
代码示例来源:origin: geotools/geotools
btn = new JButton(new NoToolAction(mapPane));
btn.setName(TOOLBAR_POINTER_BUTTON_NAME);
toolBar.add(btn);
cursorToolGrp.add(btn);
btn = new JButton(new ZoomInAction(mapPane));
btn.setName(TOOLBAR_ZOOMIN_BUTTON_NAME);
toolBar.add(btn);
cursorToolGrp.add(btn);
toolBar.add(btn);
cursorToolGrp.add(btn);
btn = new JButton(new PanAction(mapPane));
btn.setName(TOOLBAR_PAN_BUTTON_NAME);
toolBar.add(btn);
cursorToolGrp.add(btn);
btn = new JButton(new InfoAction(mapPane));
btn.setName(TOOLBAR_INFO_BUTTON_NAME);
toolBar.add(btn);
btn = new JButton(new ResetAction(mapPane));
btn.setName(TOOLBAR_RESET_BUTTON_NAME);
toolBar.add(btn);
代码示例来源:origin: magefree/mage
mageToolbar.add(btnPreferences);
mageToolbar.add(jSeparator4);
mageToolbar.add(btnConnect);
mageToolbar.add(jSeparator1);
mageToolbar.add(btnDeckEditor);
mageToolbar.add(jSeparator2);
mageToolbar.add(btnCollectionViewer);
mageToolbar.add(jSeparator5);
mageToolbar.add(btnSendFeedback);
mageToolbar.add(jSeparator6);
mageToolbar.add(btnSymbols);
mageToolbar.add(jSeparatorSymbols);
mageToolbar.add(btnImages);
mageToolbar.add(jSeparatorImages);
mageToolbar.add(btnAbout);
mageToolbar.add(jSeparator7);
jMemUsageLabel.setFocusable(false);
jMemUsageLabel.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
mageToolbar.add(jMemUsageLabel);
代码示例来源:origin: pentaho/mondrian
jToolBar1.add(addCubeButton);
jToolBar1.add(addDimensionButton);
jToolBar1.add(addDimensionUsageButton);
jToolBar1.add(addHierarchyButton);
jToolBar1.add(addNamedSetButton);
jToolBar1.add(addUserDefinedFunctionButton);
jToolBar1.add(addCalculatedMemberButton);
jToolBar1.add(addMeasureButton);
jToolBar1.add(addLevelButton);
jToolBar1.add(addPropertyButton);
jToolBar1.add(addCalculatedMemberPropertyButton);
jToolBar1.addSeparator();
jToolBar1.add(addVirtualCubeButton);
jToolBar1.add(addVirtualCubeDimensionButton);
jToolBar1.add(addVirtualCubeMeasureButton);
jToolBar1.addSeparator();
jToolBar1.add(addRoleButton);
jToolBar1.addSeparator();
jToolBar1.add(cutButton);
jToolBar1.add(copyButton);
jToolBar1.add(pasteButton);
jToolBar1.addSeparator();
jToolBar1.add(deleteButton);
jToolBar1.addSeparator();
jToolBar1.add(editModeButton);
代码示例来源:origin: magefree/mage
tbColor.add(tbRed);
tbColor.add(tbGreen);
tbColor.add(tbBlue);
tbColor.add(tbBlack);
tbColor.add(tbWhite);
tbColor.add(tbColorless);
tbColor.add(jSeparator1);
tbColor.add(cbExpansionSet);
tbColor.add(btnExpansionSearch);
tbColor.add(jSeparator2);
tbColor.add(chkPennyDreadful);
tbColor.add(btnBooster);
tbColor.add(btnClear);
tbTypes.add(tbLand);
tbTypes.add(tbCreatures);
tbTypes.add(tbArifiacts);
代码示例来源:origin: org.openrdf/sesame
protected JToolBar _createToolBar() {
JToolBar toolBar = new JToolBar();
toolBar.add(_newAction);
toolBar.addSeparator();
toolBar.add(_loadFromServerAction);
toolBar.add(_sendToServerAction);
toolBar.addSeparator();
toolBar.add(_openFileAction);
toolBar.add(_saveFileAction);
return toolBar;
}
代码示例来源:origin: pentaho/mondrian
jToolBar1 = new javax.swing.JToolBar();
jToolBar2 = new javax.swing.JToolBar();
toolbarNewPopupMenu = new JPopupMenu();
toolbarNewButton = new javax.swing.JButton();
jToolBar2.add(toolbarNewButton);
jToolBar1.add(jPanel2, 0);
jToolBar1.add(toolbarOpenButton);
jToolBar1.add(toolbarSaveButton);
jToolBar1.add(toolbarSaveAsButton);
jToolBar1.add(jPanel1);
jToolBar1.add(toolbarPreferencesButton);
代码示例来源:origin: com.synaptix/SynaptixSwing
private JComponent buildStatusEditor() {
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.add(menuSelectionAction);
toolBar.addSeparator();
toolBar.add(allSelectionAction);
toolBar.addSeparator();
toolBar.add(noneSelectionAction);
return toolBar;
}
代码示例来源:origin: magefree/mage
btnStateWaiting.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnStateWaiting.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnStateWaiting);
btnStateActive.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnStateActive.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnStateActive);
btnStateFinished.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnStateFinished.addActionListener(evt -> btnStateFinishedActionPerformed(evt));
filterBar1.add(btnStateFinished);
filterBar1.add(jSeparator1);
btnTypeMatch.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnTypeMatch.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnTypeMatch);
btnTypeTourneyConstructed.setVerifyInputWhenFocusTarget(false);
btnTypeTourneyConstructed.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnTypeTourneyConstructed);
btnTypeTourneyLimited.setVerifyInputWhenFocusTarget(false);
btnTypeTourneyLimited.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnTypeTourneyLimited);
filterBar1.add(jSeparator4);
btnSkillBeginner.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnSkillBeginner.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnSkillBeginner);
代码示例来源:origin: ribomation/DroidAtScreen1
public static JToolBar createToolbar(String... commandNames) {
JToolBar tb = new JToolBar();
for (String cmdName : commandNames) {
if (cmdName.equals("-")) {
tb.addSeparator();
} else {
tb.add(Command.get(cmdName).createButton());
}
}
return tb;
}
内容来源于网络,如有侵权,请联系作者删除!