Java JButton Create createButtonPanel()

Here you can find the source of createButtonPanel()

Description

Create and return the button panel.

License

Open Source License

Return

the button panel

Declaration

private static JPanel createButtonPanel() 

Method Source Code

//package com.java2s;
/*//from   w  w  w  . j  a va2 s  . co  m
    
dsh-iconbundle-tango-examples  Examples using the iconbundle-tango library.
Copyright (c) 2005-2013 held jointly by the individual authors.
    
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or (at
your option) any later version.
    
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
License for more details.
    
You should have received a copy of the GNU Lesser General Public License
along with this library;  if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
    
> http://www.fsf.org/licensing/licenses/lgpl.html
> http://www.opensource.org/licenses/lgpl-license.php
    
*/

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;

import javax.swing.JPanel;

import javax.swing.border.EmptyBorder;

public class Main {
    /**
     * Create and return the button panel.
     *
     * @return the button panel
     */
    private static JPanel createButtonPanel() {
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
        buttonPanel.setBorder(new EmptyBorder(0, 20, 20, 20));
        // todo:  use osx built-in help
        buttonPanel.add(new JButton("Help"));
        buttonPanel.add(Box.createGlue());
        buttonPanel.add(Box.createGlue());
        buttonPanel.add(Box.createGlue());
        return buttonPanel;
    }
}

Related

  1. createButton(String text, boolean parse)
  2. createButton(String text, String icon)
  3. createButton16(final ImageIcon icon)
  4. createButtonFooter(JButton ok, JButton cancel)
  5. createButtonGroup(javax.swing.AbstractButton... buttons)
  6. createButtonRow(List buttons)
  7. createButtonsPanel(JComponent... components)
  8. createCheckbox(String boxlabel, String[] buttons, boolean[] checked, ActionListener al)
  9. createCustomButton(Action a)