Search in sources :

Example 91 with JToolBar

use of javax.swing.JToolBar in project lotro-companion by dmorcellet.

the class AccountsManagementController method buildPanel.

private JPanel buildPanel() {
    JPanel ret = GuiFactory.buildBackgroundPanel(new BorderLayout());
    _toolbar = buildToolBar();
    JToolBar toolbar = _toolbar.getToolBar();
    ret.add(toolbar, BorderLayout.NORTH);
    _accountsTable = buildToonsTable();
    JTable table = _accountsTable.getTable();
    JScrollPane scroll = GuiFactory.buildScrollPane(table);
    ret.add(scroll, BorderLayout.CENTER);
    return ret;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTable(javax.swing.JTable) JToolBar(javax.swing.JToolBar)

Example 92 with JToolBar

use of javax.swing.JToolBar in project cytoscape-impl by cytoscape.

the class TableBrowserToolBar method getToolBar.

private JToolBar getToolBar() {
    if (toolBar == null) {
        toolBar = new JToolBar();
        toolBar.setFloatable(false);
        toolBar.setOrientation(JToolBar.HORIZONTAL);
        toolBar.setOpaque(!isAquaLAF());
        final GroupLayout layout = new GroupLayout(toolBar);
        toolBar.setLayout(layout);
        hToolBarGroup = layout.createSequentialGroup();
        vToolBarGroup = layout.createParallelGroup(Alignment.CENTER, false);
        // Layout information.
        layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(hToolBarGroup));
        layout.setVerticalGroup(vToolBarGroup);
    }
    return toolBar;
}
Also used : GroupLayout(javax.swing.GroupLayout) JToolBar(javax.swing.JToolBar)

Example 93 with JToolBar

use of javax.swing.JToolBar in project WorldPainter by Captain-Chaos.

the class AKDockLayout method flipSeparators.

private void flipSeparators(Component c, int orientn) {
    if (c != null && c instanceof JToolBar && UIManager.getLookAndFeel().getName().toLowerCase().indexOf("windows") != -1) {
        JToolBar jtb = (JToolBar) c;
        Component[] comps = jtb.getComponents();
        if (comps != null && comps.length > 0) {
            for (int i = 0; i < comps.length; i++) {
                try {
                    Component component = comps[i];
                    if (component != null) {
                        if (component instanceof JSeparator) {
                            jtb.remove(component);
                            JSeparator separ = new JSeparator();
                            if (orientn == SwingConstants.VERTICAL) {
                                separ.setOrientation(SwingConstants.VERTICAL);
                                separ.setMinimumSize(new Dimension(2, 6));
                                separ.setPreferredSize(new Dimension(2, 6));
                                separ.setMaximumSize(new Dimension(2, 100));
                            } else {
                                separ.setOrientation(SwingConstants.HORIZONTAL);
                                separ.setMinimumSize(new Dimension(6, 2));
                                separ.setPreferredSize(new Dimension(6, 2));
                                separ.setMaximumSize(new Dimension(100, 2));
                            }
                            jtb.add(separ, i);
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
Also used : JToolBar(javax.swing.JToolBar) Dimension(java.awt.Dimension) Component(java.awt.Component) JSeparator(javax.swing.JSeparator)

Example 94 with JToolBar

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

the class RendererManager method refresh.

private void refresh() {
    panel.removeAll();
    loadModelManagedRenderers();
    // Show renderers in inverse execution order to make it intuitive for users (last executed renderers remain on top of the image)
    for (int i = renderersList.size() - 1; i >= 0; i--) {
        JToolBar bar = new JToolBar();
        bar.setFloatable(false);
        if (UIUtils.isAquaLookAndFeel()) {
            bar.setBackground(UIManager.getColor("NbExplorerView.background"));
        }
        bar.add(new MoveRendererButton(i, true));
        bar.add(new MoveRendererButton(i, false));
        bar.add(renderersList.get(i));
        panel.add(bar, "wrap");
    }
    panel.updateUI();
}
Also used : JToolBar(javax.swing.JToolBar)

Example 95 with JToolBar

use of javax.swing.JToolBar in project activityinfo by bedatadriven.

the class AdminListWindow method addToolBar.

private void addToolBar() {
    final JButton exportButton = new JButton("Export");
    exportButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            TableExporter.export(tableModel, exportButton);
        }
    });
    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.add(exportButton);
    toolBar.addSeparator();
    getContentPane().add(toolBar, BorderLayout.PAGE_START);
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JToolBar(javax.swing.JToolBar)

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