Java Utililty Methods JButton Create

List of utility methods to do JButton Create

Description

The list of methods to do JButton Create are organized into topic(s).

Method

JButtoncreateJButton(final String label, final Font font)
Creates a JButton .
final JButton result = new JButton(label);
result.setFont(font);
return result;
JButtoncreateJButton(String label, Font font)
Creates a JButton .
JButton result = new JButton(label);
result.setFont(font);
return result;
JButtoncreateJButton(String text, String name, ActionListener a)
Creates a JButton with a given text, a given name and a given ActionListener.
JButton jb = new JButton(text);
jb.setName(name);
jb.addActionListener(a);
return jb;
JLabelcreateLabelButton(String text)
create Label Button
JLabel b = new JLabel(text);
b.setCursor(new Cursor(Cursor.HAND_CURSOR));
return b;
JButtoncreateListButton(Action action)
create List Button
JButton btnButton = new JButton(action);
btnButton.setToolTipText(btnButton.getText());
btnButton.setText("");
btnButton.setBorderPainted(false);
btnButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
btnButton.setFocusable(false);
btnButton.setHorizontalAlignment(SwingConstants.LEFT);
return btnButton;
...
JButtoncreateNoURLGraphicalButton(String imageName, String alternateText)
Creates a JButton using imageName, or if imageName is unavailable, use alternateText
return new JButton(alternateText, new ImageIcon(imageName));
JPanelcreateOkCancelPanel(final JButton okBtn, final JButton cancelBtn)
create Ok Cancel Panel
return createOkCancelPanel(okBtn, cancelBtn, new JButton[0]);
voidCreateOptionButtonGroup(Box boxGeneric, Border bdrButtonGroup, String[] elements, String[] commandActions, Dimension elementDimension)
Create Option Button Group
ButtonGroup group = new ButtonGroup();
JRadioButton optElement;
int i = 0;
boxGeneric.setBorder(bdrButtonGroup);
for (String iterElement : elements) {
    optElement = new JRadioButton(iterElement);
    optElement.setActionCommand(commandActions[i]);
    if (elementDimension != null) {
...
JRadioButtoncreateRadioButton(JComponent parent, String text)
Creates and returns a radio button with the given text.
JRadioButton button = new JRadioButton();
button.setText(text);
parent.add(button);
return button;
JRadioButtoncreateRadioButton(String name, String command, boolean isSelected, ActionListener listener)
Creates a radio button with all the properties set up front.
JRadioButton button;
button = new JRadioButton(name);
button.setActionCommand(command);
button.setSelected(isSelected);
button.addActionListener(listener);
return button;