//:Ex11.java

import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.border.*;
import javax.swing.table.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import java.io.*;
import java.net.*;



public class Ex11 extends JFrame { 

	//Primitives ...
	//Collections ...

	 public Ex11 () {
		Container container = null; 
		JPanel P1 = null; 
		JPanel P2 = null; 
		JLabel L1 = null; 
		ButtonGroup RB1 = null; 
		JRadioButton R1 = null; 
		JRadioButton R2 = null; 
		JRadioButton R3 = null; 
		JPanel P3 = null; 
		JLabel L2 = null; 
		ButtonGroup RB2 = null; 
		JRadioButton R4 = null; 
		JRadioButton R5 = null; 
		JRadioButton R6 = null; 
		JPanel P4 = null; 
		JLabel L3 = null; 

		container  = this.getContentPane();
		setTitle("F1"); 
		setVisible(true); 
		setSize(300,300); 
		setLocation(10,50); 

		container.setLayout( new BorderLayout(5, 5)); 
		P1 = new JPanel();
		P1.setBorder(new LineBorder(Color.black,1)); 
		container.add(P1, "North" ); 

		P1.setLayout( new BoxLayout(P1, BoxLayout.X_AXIS)); 
		P2 = new JPanel();
		P2.setBorder(new LineBorder(Color.black,1)); 
		P1.add(P2); 

		P2.setLayout( new GridLayout(4, 1, 2, 2)); 
		L1 = new JLabel();
		L1.setText("Font");
		P2.add(L1); 

		RB1 = new ButtonGroup();

		R1 = new JRadioButton();
		R1.setSelected(true); 
		R1.setText("Serif");
		RB1.add(R1); 
		P2.add(R1); 

		R2 = new JRadioButton();
		R2.setSelected(false); 
		R2.setText("SanSerif");
		RB1.add(R2); 
		P2.add(R2); 

		R3 = new JRadioButton();
		R3.setSelected(false); 
		R3.setText("MonoSpaced");
		RB1.add(R3); 
		P2.add(R3); 

		P3 = new JPanel();
		P3.setBorder(new LineBorder(Color.black,1)); 
		P1.add(P3); 

		P3.setLayout( new GridLayout(4, 1, 2, 2)); 
		L2 = new JLabel();
		L2.setText("Font Type");
		P3.add(L2); 

		RB2 = new ButtonGroup();

		R4 = new JRadioButton();
		R4.setSelected(false); 
		R4.setText("Plain");
		RB2.add(R4); 
		P3.add(R4); 

		R5 = new JRadioButton();
		R5.setSelected(false); 
		R5.setText("Bold");
		RB2.add(R5); 
		P3.add(R5); 

		R6 = new JRadioButton();
		R6.setSelected(false); 
		R6.setText("Italic");
		RB2.add(R6); 
		P3.add(R6); 

		P4 = new JPanel();
		P4.setBorder(new LineBorder(Color.black,1)); 
		container.add(P4, "Center" ); 

		P4.setLayout( new FlowLayout(FlowLayout.CENTER, 5, 5)); 
		L3 = new JLabel();
		L3.setText("Check or Uncheck Radio Button?");
		Icon L3Icon = new ImageIcon("gif1.gif"); 
		L3.setIcon(L3Icon); 
		P4.add(L3); 

	}

	// Methods ... 

	// Models .. 

	// Model Class .. 

	public static void main(String[] args)  { 
		Ex11 Ex111 = new Ex11();
		Ex111.show();
		Ex111.addWindowListener( new WindowAdapter()  {
			public void windowClosing(WindowEvent we)   {
				 System.exit(0);
		}} );
	}

}

