Hello,
I am struggling to figureout how to create a titled border around a group of Radio Buttons. Here is my code so far. Any assistence will be greatly appreciated. Thanks in advance.
Code:
import javax.swing.*;
import javax.swing.JFrame;
import javax.swing.border.LineBorder;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
import java.awt.*;

class borderPractice extends JFrame
{
	
	public borderPractice()
	{
		setTitle("Border Test");
		setSize(350, 350);
		setLocation(300,300);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JPanel content = (JPanel) getContentPane();
		content.setLayout(new GridLayout(6,2,3,3));
		
		
		JPanel p = new JPanel();		
		p = new JPanel();
		p.setBorder(new LineBorder(Color.black, 5));					
		p.add(new JLabel("Trying to get the 2 RadioButtons inside here!"));	
	
		
		JRadioButton rb1 = new JRadioButton("Option 1", true);
		JRadioButton rb2 = new JRadioButton("Option 2", false);
		
		
		ButtonGroup group = new ButtonGroup();
		group.add(rb1);
		group.add(rb2);
				
		
		content.add(rb1);
		content.add(rb2);
		content.add(p);
		
		setVisible (true);
				
	}
		
	public static void main( String args[])
	{
		borderPractice bp = new borderPractice();
		
	}
	
}