Search in sources :

Example 71 with JToolBar

use of javax.swing.JToolBar in project ACS by ACS-Community.

the class ErrorTreeCellRenderer method getJToolBar.

/**
	 * This method initializes jToolBar	
	 * 	
	 * @return javax.swing.JToolBar	
	 */
private JToolBar getJToolBar() {
    if (jToolBar == null) {
        locationField = new JLabel();
        locationField.setText("(none)");
        locationField.setBackground(Color.WHITE);
        jLabel = new JLabel();
        jLabel.setText("Path:  ");
        jToolBar = new JToolBar();
        jToolBar.setFloatable(false);
        jToolBar.add(getNewDocButton());
        jToolBar.add(getEditButton());
        jToolBar.add(getCancelEditButton());
        jToolBar.add(getSaveButton());
        jToolBar.addSeparator();
        jToolBar.addSeparator();
        jToolBar.addSeparator();
        jToolBar.add(jLabel);
        jToolBar.add(locationField);
        jToolBar.add(getDeleteDocButton());
    }
    return jToolBar;
}
Also used : JLabel(javax.swing.JLabel) JToolBar(javax.swing.JToolBar)

Example 72 with JToolBar

use of javax.swing.JToolBar in project ACS by ACS-Community.

the class ErrorLogDialog method initGUI.

/**
	 * Builds the content of the GUI
	 *
	 */
private void initGUI() {
    ImageIcon icon = new ImageIcon(LogTypeHelper.class.getResource("/errorLogIcon.png"));
    setIconImage(icon.getImage());
    synchronized (logTA) {
        logTA.setDocument(document);
        logTA.setEditable(false);
    }
    JScrollPane logSP = new JScrollPane(logTA);
    JRootPane mainPnl = this.getRootPane();
    mainPnl.setLayout(new BorderLayout());
    mainPnl.add(logSP, BorderLayout.CENTER);
    // Close button
    JPanel btnPnl = new JPanel(new FlowLayout());
    closeBtn = new JButton("Close");
    closeBtn.addActionListener(this);
    btnPnl.add(closeBtn);
    mainPnl.add(btnPnl, BorderLayout.SOUTH);
    // Build the toolbar
    toolBar = new JToolBar();
    JPanel toolBarPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    ImageIcon cleanIcon = new ImageIcon(ErrorLogDialog.class.getResource("/delete.png"));
    cleanAllBtn = new JButton("<HTML><Font size=\"-1\">Clean</FONT></HTML>", cleanIcon);
    cleanAllBtn.addActionListener(this);
    cleanAllBtn.setToolTipText("Delete log");
    ImageIcon saveIcon = new ImageIcon(ErrorLogDialog.class.getResource("/disk.png"));
    saveAllBtn = new JButton("<HTML><Font size=\"-1\">Save</FONT></HTML>", saveIcon);
    saveAllBtn.addActionListener(this);
    saveAllBtn.setToolTipText("Save log");
    toolBarPanel.add(cleanAllBtn);
    toolBarPanel.add(saveAllBtn);
    toolBar.add(toolBarPanel);
    mainPnl.add(toolBar, BorderLayout.PAGE_START);
    rationalizeButtons();
}
Also used : JScrollPane(javax.swing.JScrollPane) ImageIcon(javax.swing.ImageIcon) JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) LogTypeHelper(com.cosylab.logging.engine.log.LogTypeHelper) JButton(javax.swing.JButton) JRootPane(javax.swing.JRootPane) JToolBar(javax.swing.JToolBar)

Example 73 with JToolBar

use of javax.swing.JToolBar in project adempiere by adempiere.

the class VTreePanel method barRemove.

//  addToBar
/**
	 *  Remove from Bar
	 */
private void barRemove() {
    //the button in on a JToolBar which is on a CPanel
    JToolBar parentBar = (JToolBar) m_buttonSelected.getParent();
    Container parentPanel = null;
    if (parentBar != null) {
        parentPanel = parentBar.getParent();
    }
    for (JToolBar jt : toolbar) {
        jt.remove(m_buttonSelected);
    }
    if (parentPanel != null && parentBar.getComponentCount() == 1) {
        //only label left
        bar.remove(parentPanel);
        //remove from toolBarMap..
        toolbarMap.values().remove(parentBar);
    }
    bar.validate();
    bar.repaint();
    barDBupdate(false, Integer.parseInt(m_buttonSelected.getActionCommand()));
}
Also used : Container(java.awt.Container) JXTaskPaneContainer(org.jdesktop.swingx.JXTaskPaneContainer) JToolBar(javax.swing.JToolBar)

Example 74 with JToolBar

use of javax.swing.JToolBar in project JMRI by JMRI.

the class JToolBarUtil method loadToolBar.

public static JToolBar loadToolBar(String name, WindowInterface wi, Object context) {
    Element root = rootFromName(name);
    JToolBar retval = new JToolBar(root.getChild("name").getText());
    for (Object item : root.getChildren("node")) {
        Action act = actionFromNode((Element) item, wi, context);
        if (act == null) {
            continue;
        }
        if (act.getValue(javax.swing.Action.SMALL_ICON) != null) {
            // icon present, add explicitly
            JButton b = new JButton((javax.swing.Icon) act.getValue(javax.swing.Action.SMALL_ICON));
            b.setAction(act);
            retval.add(b);
        } else {
            retval.add(new JButton(act));
        }
    }
    return retval;
}
Also used : Action(javax.swing.Action) Element(org.jdom2.Element) JButton(javax.swing.JButton) JToolBar(javax.swing.JToolBar)

Example 75 with JToolBar

use of javax.swing.JToolBar in project jdk8u_jdk by JetBrains.

the class InsetsEncapsulation method run.

@Override
public void run() {
    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());
    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");
    }
}
Also used : JDesktopPane(javax.swing.JDesktopPane) JTextArea(javax.swing.JTextArea) JRadioButton(javax.swing.JRadioButton) JLayeredPane(javax.swing.JLayeredPane) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JProgressBar(javax.swing.JProgressBar) JTableHeader(javax.swing.table.JTableHeader) JTextField(javax.swing.JTextField) JSeparator(javax.swing.JSeparator) JScrollBar(javax.swing.JScrollBar) JTextPane(javax.swing.JTextPane) JToggleButton(javax.swing.JToggleButton) JSlider(javax.swing.JSlider) JMenuItem(javax.swing.JMenuItem) JComponent(javax.swing.JComponent) Component(java.awt.Component) JScrollPane(javax.swing.JScrollPane) JViewport(javax.swing.JViewport) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) JRadioButtonMenuItem(javax.swing.JRadioButtonMenuItem) JToolBar(javax.swing.JToolBar) JOptionPane(javax.swing.JOptionPane) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) JPopupMenu(javax.swing.JPopupMenu) JCheckBox(javax.swing.JCheckBox) JTree(javax.swing.JTree) JFileChooser(javax.swing.JFileChooser) JPasswordField(javax.swing.JPasswordField) JTable(javax.swing.JTable) JEditorPane(javax.swing.JEditorPane) JSpinner(javax.swing.JSpinner) JRootPane(javax.swing.JRootPane) JSplitPane(javax.swing.JSplitPane) JColorChooser(javax.swing.JColorChooser) JInternalFrame(javax.swing.JInternalFrame) JMenu(javax.swing.JMenu) JMenuBar(javax.swing.JMenuBar)

Aggregations

JToolBar (javax.swing.JToolBar)124 JButton (javax.swing.JButton)51 BorderLayout (java.awt.BorderLayout)45 JPanel (javax.swing.JPanel)37 JScrollPane (javax.swing.JScrollPane)30 Dimension (java.awt.Dimension)25 Insets (java.awt.Insets)25 ActionEvent (java.awt.event.ActionEvent)24 JLabel (javax.swing.JLabel)23 ActionListener (java.awt.event.ActionListener)19 ImageIcon (javax.swing.ImageIcon)17 Component (java.awt.Component)14 JSplitPane (javax.swing.JSplitPane)14 JTable (javax.swing.JTable)14 JTextField (javax.swing.JTextField)14 JPopupMenu (javax.swing.JPopupMenu)13 JToggleButton (javax.swing.JToggleButton)12 GridBagConstraints (java.awt.GridBagConstraints)10 GridBagLayout (java.awt.GridBagLayout)10 JComponent (javax.swing.JComponent)10