Java JButton Create createListButton(Action action)

Here you can find the source of createListButton(Action action)

Description

create List Button

License

Open Source License

Declaration

public static JButton createListButton(Action action) 

Method Source Code

//package com.java2s;

import java.awt.Cursor;

import javax.swing.Action;
import javax.swing.JButton;

import javax.swing.SwingConstants;

public class Main {
    public static JButton createListButton(Action action) {
        JButton btnButton = new JButton(action);

        btnButton.setToolTipText(btnButton.getText());
        btnButton.setText("");
        btnButton.setBorderPainted(false);
        btnButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
        btnButton.setFocusable(false);/*from ww  w  .j a  v  a  2 s .c  o m*/
        btnButton.setHorizontalAlignment(SwingConstants.LEFT);

        return btnButton;
    }
}

Related

  1. createJButton(Container c, String caption, int x, int y, int width, int height, ActionListener al)
  2. createJButton(final String label, final Font font)
  3. createJButton(String label, Font font)
  4. createJButton(String text, String name, ActionListener a)
  5. createLabelButton(String text)
  6. createNoURLGraphicalButton(String imageName, String alternateText)
  7. createOkCancelPanel(final JButton okBtn, final JButton cancelBtn)
  8. CreateOptionButtonGroup(Box boxGeneric, Border bdrButtonGroup, String[] elements, String[] commandActions, Dimension elementDimension)
  9. createRadioButton(JComponent parent, String text)