
hello sir i want to use tabbed in my project and i want that if i clicked one tabbed then open one form and if i click another tabbed then it open another form
can plz help me
Thank you

Hello Friend,
Try the following code:
import java.awt.*;
import javax.swing.*;
class Information {
JFrame f;
JPanel p1,p2;
JTabbedPane tp;
JLabel l1, l2, l3, l4,l5,l6,l7,l8;
JTextField tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8;
JButton add1,add2 ;
Information(){
f=new JFrame("Form");
p1=new JPanel(new GridLayout(5,2));
p2=new JPanel(new GridLayout(5,2));
tp=new JTabbedPane();
l1=new JLabel("Name:");
l2=new JLabel("Address:");
l3=new JLabel("Contact No:");
l4=new JLabel("Email:");
l5=new JLabel("Highschool:");
l6=new JLabel("Intermediate:");
l7=new JLabel("Graduation:");
l8=new JLabel("Post Graduation:");
tf1=new JTextField(12);
tf2=new JTextField(12);
tf3=new JTextField(12);
tf4=new JTextField(12);
tf5=new JTextField(12);
tf6=new JTextField(12);
tf7=new JTextField(12);
tf8=new JTextField(12);
add1=new JButton(" Add ");
add2=new JButton(" Add");
p1.add(l1);
p1.add(tf1);
p1.add(l2);
p1.add(tf2);
p1.add(l3);
p1.add(tf3);
p1.add(l4);
p1.add(tf4);
p1.add(add1);
p2.add(l5);
p2.add(tf5);
p2.add(l6);
p2.add(tf6);
p2.add(l7);
p2.add(tf7);
p2.add(l8);
p2.add(tf8);
p2.add(add2);
f.getContentPane().add(tp);
tp.addTab("Personal Information",p1);
tp.addTab("Professional Information",p2);
f.setSize(350,180);
f.setVisible(true);
f.setResizable(true);
}
public static void main(String z[]){
new Information();
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.