//:Ex8.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 Ex8 extends JFrame { 

	//Primitives ...
	//Collections ...

	 public Ex8 () {
		Container container = null; 
		JTabbedPane TB = null; 
		JPanel P1 = null; 
		JLabel L1 = null; 
		JPanel P2 = null; 
		JLabel L2 = null; 
		JPanel P3 = null; 
		JLabel L3 = null; 

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

		container.setLayout( new BorderLayout(5, 5)); 
		TB = new JTabbedPane();
		TB.setTabPlacement(JTabbedPane.BOTTOM); 
		TB.setPreferredSize( new Dimension(50,50)); 
		container.add(TB, "Center" ); 

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

		TB.addTab("Label - 1", P1); 

		P1.setLayout( new FlowLayout(FlowLayout.CENTER, 5, 5)); 
		L1 = new JLabel();
		L1.setText("Label - 1");
		Icon L1Icon = new ImageIcon("gif1.gif"); 
		L1.setIcon(L1Icon); 
		P1.add(L1); 

		P2 = new JPanel();
		P2.setBorder(new LineBorder(Color.black,1)); 

		TB.addTab("Label - 2", P2); 

		P2.setLayout( new FlowLayout(FlowLayout.CENTER, 5, 5)); 
		L2 = new JLabel();
		L2.setText("Label - 2");
		Icon L2Icon = new ImageIcon("gif2.gif"); 
		L2.setIcon(L2Icon); 
		P2.add(L2); 

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

		TB.addTab("Label - 3", P3); 

		P3.setLayout( new FlowLayout(FlowLayout.CENTER, 5, 5)); 
		L3 = new JLabel();
		L3.setText("Label - 3");
		Icon L3Icon = new ImageIcon("gif3.gif"); 
		L3.setIcon(L3Icon); 
		P3.add(L3); 

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