Java JButton Create createRadioButton(JComponent parent, String text)

Here you can find the source of createRadioButton(JComponent parent, String text)

Description

Creates and returns a radio button with the given text.

License

Open Source License

Declaration

public static JRadioButton createRadioButton(JComponent parent, String text) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.*;

public class Main {
    /**//from   www  .  ja  va  2 s . c  om
     * Creates and returns a radio button with the given text.
     */
    public static JRadioButton createRadioButton(JComponent parent, String text) {
        JRadioButton button = new JRadioButton();
        button.setText(text);
        parent.add(button);
        return button;
    }
}

Related

  1. createLabelButton(String text)
  2. createListButton(Action action)
  3. createNoURLGraphicalButton(String imageName, String alternateText)
  4. createOkCancelPanel(final JButton okBtn, final JButton cancelBtn)
  5. CreateOptionButtonGroup(Box boxGeneric, Border bdrButtonGroup, String[] elements, String[] commandActions, Dimension elementDimension)
  6. createRadioButton(String name, String command, boolean isSelected, ActionListener listener)
  7. createRadioButton(String text, ButtonGroup buttonGroup, ActionListener... listeners)
  8. createRadioButton(String text, int mnemonic, ActionListener listener, boolean selected)
  9. createRadioButtonGrouping(String elements[], String title)