Here you can find the source of createRadioButton(JComponent parent, String text)
public static JRadioButton createRadioButton(JComponent parent, String text)
//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; } }