use of javax.swing.JToolBar in project pcgen by PCGen.
the class ToolBarUtilities method createDefaultToolBar.
public static JToolBar createDefaultToolBar() {
JToolBar toolbar = new JToolBar();
toolbar.setFloatable(false);
toolbar.setRollover(true);
return toolbar;
}
use of javax.swing.JToolBar in project voltdb by VoltDB.
the class DatabaseManagerSwing method createToolBar.
protected JToolBar createToolBar() {
// Build jtoolbar and jtoolbar Buttons
JToolBar jtoolbar = new JToolBar();
jtoolbar.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
// I'm dropping "Statement" from "Execute SQL Statement", etc.,
// because it may or may not be "one statement", but it is SQL.
// Build jbuttonClear Buttons - blaine
jbuttonClear = new JButton("Clear SQL", new ImageIcon(CommonSwing.getIcon("Clear")));
jbuttonClear.putClientProperty("is3DEnabled", Boolean.TRUE);
tipMap.put(jbuttonClear, "Clear SQL");
jbuttonClear.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionevent) {
if (sqlScriptBuffer == null && txtCommand.getText().length() < 1) {
CommonSwing.errorMessage("No SQL to clear");
return;
}
clear();
}
});
jbuttonExecute = new JButton("Execute SQL", new ImageIcon(CommonSwing.getIcon("Execute")));
tipMap.put(jbuttonExecute, "Execute SQL");
jbuttonExecute.putClientProperty("is3DEnabled", Boolean.TRUE);
jbuttonExecute.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionevent) {
executeCurrentSQL();
}
});
jtoolbar.addSeparator();
jtoolbar.add(jbuttonClear);
jtoolbar.addSeparator();
jtoolbar.add(jbuttonExecute);
jtoolbar.addSeparator();
jbuttonClear.setAlignmentY(0.5F);
jbuttonClear.setAlignmentX(0.5F);
jbuttonExecute.setAlignmentY(0.5F);
jbuttonExecute.setAlignmentX(0.5F);
return jtoolbar;
}
use of javax.swing.JToolBar in project pcgen by PCGen.
the class NotesView method initComponents.
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
private void initComponents() {
//GEN-BEGIN:initComponents
jSplitPane1 = new FlippingSplitPane();
jScrollPane1 = new JScrollPane();
notesTree = new JTree();
jPanel1 = new JPanel();
jScrollPane2 = new JScrollPane();
editor = new JTextPane();
jPanel2 = new JPanel();
fileBar = new JToolBar();
newButton = new JButton();
saveButton = new JButton();
exportButton = new JButton();
revertButton = new JButton();
deleteButton = new JButton();
clipboardBar = new JToolBar();
cutButton = new JButton();
copyButton = new JButton();
pasteButton = new JButton();
formatBar = new JToolBar();
sizeCB = new JComboBox();
boldButton = new JButton();
italicButton = new JButton();
underlineButton = new JButton();
colorButton = new JButton();
bulletButton = new JButton();
enumButton = new JButton();
imageButton = new JButton();
alignmentBar = new JToolBar();
leftJustifyButton = new JButton();
centerJustifyButton = new JButton();
rightJustifyButton = new JButton();
filePane = new JPanel();
fileLeft = new JButton();
fileRight = new JButton();
filesBar = new JToolBar();
setLayout(new java.awt.BorderLayout());
jSplitPane1.setDividerLocation(175);
jSplitPane1.setDividerSize(5);
jScrollPane1.setViewportView(notesTree);
jSplitPane1.setLeftComponent(jScrollPane1);
jPanel1.setLayout(new java.awt.BorderLayout());
editor.addCaretListener(this::editorCaretUpdate);
jScrollPane2.setViewportView(editor);
jPanel1.add(jScrollPane2, java.awt.BorderLayout.CENTER);
jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 0));
newButton.setIcon(Icons.stock_new.getImageIcon());
newButton.setToolTipText("New Node");
newButton.setBorder(new EtchedBorder());
newButton.setEnabled(false);
newButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
newButtonActionPerformed();
}
});
fileBar.add(newButton);
saveButton.setIcon(Icons.stock_save.getImageIcon());
saveButton.setToolTipText("Save Node");
saveButton.setBorder(new EtchedBorder());
saveButton.setEnabled(false);
saveButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveButtonActionPerformed();
}
});
fileBar.add(saveButton);
exportButton.setIcon(Icons.stock_export.getImageIcon());
exportButton.setToolTipText("Export");
exportButton.setBorder(new EtchedBorder());
exportButton.setEnabled(false);
exportButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
exportButtonActionPerformed();
}
});
fileBar.add(exportButton);
revertButton.setIcon(Icons.stock_revert.getImageIcon());
revertButton.setToolTipText("Revert to Saved");
revertButton.setBorder(new EtchedBorder());
revertButton.setEnabled(false);
revertButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
revertButtonActionPerformed();
}
});
fileBar.add(revertButton);
deleteButton.setIcon(Icons.stock_broken_image.getImageIcon());
deleteButton.setToolTipText("Delete Node");
deleteButton.setBorder(new EtchedBorder());
deleteButton.setEnabled(false);
deleteButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
deleteButtonActionPerformed();
}
});
fileBar.add(deleteButton);
jPanel2.add(fileBar);
cutButton.setIcon(Icons.stock_cut.getImageIcon());
cutButton.setToolTipText("Cut");
cutButton.setBorder(new EtchedBorder());
cutButton.addActionListener(this::cutButtonActionPerformed);
clipboardBar.add(cutButton);
copyButton.setIcon(Icons.stock_copy.getImageIcon());
copyButton.setToolTipText("Copy");
copyButton.setBorder(new EtchedBorder());
copyButton.addActionListener(this::copyButtonActionPerformed);
clipboardBar.add(copyButton);
pasteButton.setIcon(Icons.stock_paste.getImageIcon());
pasteButton.setToolTipText("Paste");
pasteButton.setBorder(new EtchedBorder());
pasteButton.addActionListener(this::pasteButtonActionPerformed);
clipboardBar.add(pasteButton);
jPanel2.add(clipboardBar);
sizeCB.setToolTipText("Size");
sizeCB.setBorder(new EtchedBorder());
sizeCB.addActionListener(this::sizeCBActionPerformed);
formatBar.add(sizeCB);
boldButton.setIcon(Icons.stock_text_bold.getImageIcon());
boldButton.setToolTipText("Bold");
boldButton.setBorder(new EtchedBorder());
boldButton.addActionListener(this::boldButtonActionPerformed);
formatBar.add(boldButton);
italicButton.setIcon(Icons.stock_text_italic.getImageIcon());
italicButton.setToolTipText("Italic");
italicButton.setBorder(new EtchedBorder());
italicButton.addActionListener(this::italicButtonActionPerformed);
formatBar.add(italicButton);
underlineButton.setIcon(Icons.stock_text_underline.getImageIcon());
underlineButton.setToolTipText("Underline");
underlineButton.setBorder(new EtchedBorder());
underlineButton.addActionListener(this::underlineButtonActionPerformed);
formatBar.add(underlineButton);
colorButton.setForeground(new java.awt.Color(0, 0, 0));
colorButton.setIcon(Icons.createImageIcon("menu-mode-RGB-alt.png"));
colorButton.setToolTipText("Color");
colorButton.setBorder(new EtchedBorder());
colorButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
colorButtonActionPerformed();
}
});
formatBar.add(colorButton);
bulletButton.setIcon(Icons.stock_list_bulet.getImageIcon());
bulletButton.setToolTipText("Bulleted List");
bulletButton.setAction(actionListUnordered);
bulletButton.setBorder(new EtchedBorder());
formatBar.add(bulletButton);
enumButton.setIcon(Icons.stock_list_enum.getImageIcon());
enumButton.setToolTipText("Numbered List");
enumButton.setAction(actionListOrdered);
enumButton.setBorder(new EtchedBorder());
formatBar.add(enumButton);
imageButton.setIcon(Icons.stock_insert_graphic.getImageIcon());
imageButton.setBorder(new EtchedBorder());
imageButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
imageButtonActionPerformed();
}
});
formatBar.add(imageButton);
jPanel2.add(formatBar);
leftJustifyButton.setIcon(Icons.stock_text_align_left.getImageIcon());
leftJustifyButton.setToolTipText("Left Justify");
leftJustifyButton.setBorder(new EtchedBorder());
leftJustifyButton.addActionListener(this::leftJustifyButtonActionPerformed);
alignmentBar.add(leftJustifyButton);
centerJustifyButton.setIcon(Icons.stock_text_align_center.getImageIcon());
centerJustifyButton.setToolTipText("Center");
centerJustifyButton.setBorder(new EtchedBorder());
centerJustifyButton.addActionListener(this::centerJustifyButtonActionPerformed);
alignmentBar.add(centerJustifyButton);
rightJustifyButton.setIcon(Icons.stock_text_align_right.getImageIcon());
rightJustifyButton.setToolTipText("Right Justify");
rightJustifyButton.setBorder(new EtchedBorder());
rightJustifyButton.addActionListener(this::rightJustifyButtonActionPerformed);
alignmentBar.add(rightJustifyButton);
jPanel2.add(alignmentBar);
jPanel1.add(jPanel2, java.awt.BorderLayout.NORTH);
filePane.setLayout(new BoxLayout(filePane, BoxLayout.X_AXIS));
fileLeft.setText("<");
fileLeft.setBorder(new EtchedBorder());
fileLeft.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
fileLeftActionPerformed();
}
});
filePane.add(fileLeft);
fileRight.setText(">");
fileRight.setBorder(new EtchedBorder());
fileRight.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
fileRightActionPerformed();
}
});
filePane.add(fileRight);
filePane.add(filesBar);
jPanel1.add(filePane, java.awt.BorderLayout.SOUTH);
jSplitPane1.setRightComponent(jPanel1);
add(jSplitPane1, java.awt.BorderLayout.CENTER);
}
use of javax.swing.JToolBar in project jdk8u_jdk by JetBrains.
the class DimensionEncapsulation method run.
@Override
public void run() {
runTest(new Panel());
runTest(new Button());
runTest(new Checkbox());
runTest(new Canvas());
runTest(new Choice());
runTest(new Label());
runTest(new Scrollbar());
runTest(new TextArea());
runTest(new TextField());
runTest(new Dialog(new JFrame()));
runTest(new Frame());
runTest(new Window(new JFrame()));
runTest(new FileDialog(new JFrame()));
runTest(new List());
runTest(new ScrollPane());
runTest(new JFrame());
runTest(new JDialog(new JFrame()));
runTest(new JWindow(new JFrame()));
runTest(new JLabel("hi"));
runTest(new JMenu());
runTest(new JTree());
runTest(new JTable());
runTest(new JMenuItem());
runTest(new JCheckBoxMenuItem());
runTest(new JToggleButton());
runTest(new JSpinner());
runTest(new JSlider());
runTest(Box.createVerticalBox());
runTest(Box.createHorizontalBox());
runTest(new JTextField());
runTest(new JTextArea());
runTest(new JTextPane());
runTest(new JPasswordField());
runTest(new JFormattedTextField());
runTest(new JEditorPane());
runTest(new JButton());
runTest(new JColorChooser());
runTest(new JFileChooser());
runTest(new JCheckBox());
runTest(new JInternalFrame());
runTest(new JDesktopPane());
runTest(new JTableHeader());
runTest(new JLayeredPane());
runTest(new JRootPane());
runTest(new JMenuBar());
runTest(new JOptionPane());
runTest(new JRadioButton());
runTest(new JRadioButtonMenuItem());
runTest(new JPopupMenu());
//runTest(new JScrollBar()); --> don't test defines max and min in
// terms of preferred
runTest(new JScrollPane());
runTest(new JViewport());
runTest(new JSplitPane());
runTest(new JTabbedPane());
runTest(new JToolBar());
runTest(new JSeparator());
runTest(new JProgressBar());
if (!failures.isEmpty()) {
System.out.println("These classes failed");
for (final Component failure : failures) {
System.out.println(failure.getClass());
}
throw new RuntimeException("Test failed");
}
}
use of javax.swing.JToolBar in project adempiere by adempiere.
the class PDFViewerBean method createToolBar.
protected void createToolBar() {
final JToolBar bar = new JToolBar();
bar.add(createActionButton(printAction, null, "22x22/document-print.png", "Print document"));
bar.add(createActionButton(saveAction, null, "22x22/document-save.png", "Save document"));
//bar.addSeparator(new Dimension(10,0));
bar.add(createActionButton(goFirstAction, null, "22x22/go-first.png", "First page"));
bar.add(createActionButton(goPreviousAction, null, "22x22/go-previous.png", "Previos page"));
final JPanel pagePanel = createToolbarItemPanel(pageField);
bar.add(pagePanel);
//bar.add(new JLabel("/"));
//bar.add(pageCountLabel);
bar.add(createActionButton(goNextAction, null, "22x22/go-next.png", "Next page"));
bar.add(createActionButton(goLastAction, null, "22x22/go-last.png", "Last page"));
//bar.addSeparator(new Dimension(10,0));
bar.add(createActionButton(zoomOutAction, null, "22x22/zoom-out.png", "Next page"));
bar.add(createToolbarItemPanel(zoomSelect));
bar.add(createActionButton(zoomInAction, null, "22x22/zoom-in.png", "Next page"));
//bar.addSeparator(new Dimension(10,0));
bar.add(createActionButton(rotateCClockAction, null, "22x22/rotate-cclock.png", "Next page"));
bar.add(createToolbarItemPanel(rotationSelect));
bar.add(createActionButton(rotateClockAction, null, "22x22/rotate-clock.png", "Next page"));
bar.setFloatable(false);
add(BorderLayout.NORTH, bar);
}
Aggregations