Sample Code :
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class MyForm {
private JFrame f;
private JPanel p1;
private JPanel p2;
private JLabel l1,l2,l3,l4;
private JTextField t1,t2,t3,t4;
private JTabbedPane tab1;
public MyForm() {
f=new JFrame("Using TabberPanel");
f.setSize(400,150);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLayout(new BorderLayout());
Container con=f.getContentPane();
con.add(tab1=new JTabbedPane(),"Center");
p1=new JPanel();
p1.setLayout(new GridLayout(4,2));
p1.add(l1=new JLabel("ID :"));
p1.add(t1=new JTextField());
p1.add(l1=new JLabel("Name :"));
p1.add(t2=new JTextField());
p1.add(l1=new JLabel("Sex :"));
p1.add(t3=new JTextField());
p1.add(l1=new JLabel("Phone :"));
p1.add(t4=new JTextField());
tab1.add("Staff",p1);
p2=new JPanel();
p2.setLayout(new GridLayout(4,2));
p2.add(l1=new JLabel("Code :"));
p2.add(t1=new JTextField());
p2.add(l1=new JLabel("Name :"));
p2.add(t2=new JTextField());
p2.add(l1=new JLabel("Phone :"));
p2.add(t3=new JTextField());
p2.add(l1=new JLabel("Address :"));
p2.add(t4=new JTextField());
tab1.add("Customer",p2);
}
public static void main(String[] args) {
new MyForm();
}
}