JRadioButton radioButton = new JRadioButton(); // Create JRadioButton. jPanel.add(radioButton); // Add JRadioButton to panel. boolean isSelected = radioButton.isSelected(); // Check if button is selected.