JRadioButton select at start

Complete source code below will show you, how to make JRadioButton select at start.

*********************************************************************
COMPLETE SOURCE CODE FOR : RadioButtonSelectAtStart.java
*********************************************************************


import javax.swing.JRadioButton;
import javax.swing.JFrame;

import java.awt.FlowLayout;

public class RadioButtonSelectAtStart
{
public static void main(String[]args)
{
//Create radio button with select at start
//You can make this radio button not select on start by change true to false
JRadioButton radioButton=new JRadioButton("I am a radio button",true);


//Create a window using JFrame with title ( JRadioButton select on start )
JFrame frame=new JFrame("JRadioButton select on start");

//Set JFrame layout
frame.setLayout(new FlowLayout());

//add created radio button into JFrame
frame.add(radioButton);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(200,65);

//Make JFrame visible
frame.setVisible(true);
}
}


*********************************************************************
JUST COMPILE AND EXECUTE IT
*********************************************************************

RELAXING NATURE VIDEO