Tabbed in java

Tabbed in java

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

View Answers

December 22, 2010 at 11:12 AM

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









Related Tutorials/Questions & Answers:
Tabbed in java
Tabbed in java  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   Hi Friend
Tabbed in java
Tabbed in java  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
Advertisements
Set the Color of a Tab in a Tabbed Pane Container in Java
Set the Color of a Tab in a Tabbed Pane Container in Java... will learn how to set colors for a tab in a tabbed pane container in Java Swing... This program shows you how to set the color for each tab in the tabbed pane
tabbed panel Helppp !!!! - Struts
tabbed panel help  i need struts tabbed panel example. Hi everybody plz ,im newbie on struts. i have to developpe a web application using struts 1.1, somebody advise me to use Tabbed Panel but i don't know how to use them
ModuleNotFoundError: No module named 'urxvt_tabbed'
ModuleNotFoundError: No module named 'urxvt_tabbed'  Hi, My Python... 'urxvt_tabbed' How to remove the ModuleNotFoundError: No module named 'urxvt_tabbed' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'urxvt_tabbed'
ModuleNotFoundError: No module named 'urxvt_tabbed'  Hi, My Python... 'urxvt_tabbed' How to remove the ModuleNotFoundError: No module named 'urxvt_tabbed' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'urxvt_tabbed'
ModuleNotFoundError: No module named 'urxvt_tabbed'  Hi, My Python... 'urxvt_tabbed' How to remove the ModuleNotFoundError: No module named 'urxvt_tabbed' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-tabbed-admin'
ModuleNotFoundError: No module named 'django-tabbed-admin'  Hi, My... named 'django-tabbed-admin' How to remove the ModuleNotFoundError: No module named 'django-tabbed-admin' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-tabbed-changeform-admin'
ModuleNotFoundError: No module named 'django-tabbed-changeform-admin' ...: No module named 'django-tabbed-changeform-admin' How to remove the ModuleNotFoundError: No module named 'django-tabbed-changeform-admin' error
ModuleNotFoundError: No module named 'django-tabbed-admin'
ModuleNotFoundError: No module named 'django-tabbed-admin'  Hi, My... named 'django-tabbed-admin' How to remove the ModuleNotFoundError: No module named 'django-tabbed-admin' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-tabbed-changeform-admin'
ModuleNotFoundError: No module named 'django-tabbed-changeform-admin' ...: No module named 'django-tabbed-changeform-admin' How to remove the ModuleNotFoundError: No module named 'django-tabbed-changeform-admin' error
color changing - Java Beginners
in java swing  Hi Friend, Try the following code: import javax.swing....){ JFrame frame = new JFrame("Tabbed Pane Frame..., BorderLayout.CENTER); tab.add("Tab 1", new JLabel("This is Tabbed Pane 1")); tab.add
java JTabbedPane() - Java Beginners
java JTabbedPane()  how to add layout manager in JTabbedPane() plese...; private JPanel panel3; public TabbedPaneTest(){ setTitle("Tabbed Pane... createPage1(); createPage2(); createPage3(); // Create a tabbed pane
XML and swings - Java Beginners
XML and swings  I have an xml file where all the contents that should be present in the tabbed pane are there. i would like to know how to parse the xml such that, whenever it reads the component type as label, it should create
Tomahawk pannelTabbedPane tag
to create a tabbed pane. Its has the capability of switching the tabs at client...; ondblclick : It is used for Java Script code to be invoked when the element is double-clicked.  onmousedown : It is used for Java Script code
java swings - Java Beginners
java swings  Hi , I need the JFileDialog simple example using jbutton. I need to put the browse option for my tabbed pane screen. Please send the favourable example code. Thanks, Valarmathi  Hi Friend, Try
java swings - Java Beginners
java swings   Hi, I have two classes(two tabbed panes). how can i get the one class jtextfield value into another class method. Please send the code as sson as possible. Thanks, Valarmathi  Hi Friend, Try
Jtabbedpane - Java Beginners
with the user by this button. So...;Java Example for adding abstarct JButton...(tab, BorderLayout.CENTER); JButton   Java Example for adding abstarct... = new JFrame("Tabbed Pane Frame"); frame.setDefaultCloseOperation
java - Java Beginners
two Panels(p1 and p2) and one tabbed pane(tp) in which i have added second panel(p2). on panel 1 i have one button(Go to Tabbed Pane). I want, when i will click on this button, then the tabbed pane should be added to the frame like
java - Java Beginners
(); Component panel1 = makeTextPanel("Java Tutorial"); tabbedPane.addTab("One", icon... panel2 = makeTextPanel("Java, JavaScript,JSP"); tabbedPane.addTab("Two", icon, panel2, "Does twice as much nothing"); Component panel3 = makeTextPanel("Java
JAVA SWING JTabbedPane - Java Beginners
JAVA SWING JTabbedPane  Hi all, I would like to ask a question... = makeTextPanel("Java Tutorial"); tabbedPane.addTab("One", icon, panel1, "Does... = makeTextPanel("Java, JavaScript,JSP"); tabbedPane.addTab("Two", icon
Hi ..I am Sakthi.. - Java Beginners
that is available in java and also starts with javax. package HEMAL RAJYAGURU  ... tabbedPane = new JTabbedPane(); Component panel1 = makeTextPanel("Java... = makeTextPanel("Java, JavaScript,JSP"); tabbedPane.addTab("Two", icon, panel2
java - Java Beginners
"); } } } how can i add the path from my tabbed pane textbox . I didnt get the path... the path to the tabbed pane in OperatingSystem.java file? Thanks  ...(osType); javapathname = new JLabel(" Java Path
Java Complication Error - Java Beginners
Java Complication Error  Hello there, I was assigned to do a project in java that I have to set up tabs and in each tab have something in them. Well...(); // Creates a tabbed pane jtabbedPane = new JTabbedPane
java - Java Beginners
regarding os information and java information for the same class using java swing tabbed panes. this is my code .please revert the mistake and send it to me... = new JScrollPane(area3); label4 = new JLabel("Java Path"); area4 = new
Enable and Disable Tab in Java
Enable and Disable Tab in Java       In this section you will learn how to enable and disable any tab in a TabbedPane component of Java Swing. The tabbed pane
Java Swing Tutorial - Learning Java Swing programming step by step
Tab in Java Set the Color of a Tab in a Tabbed Pane Container in Java...Java Swing tutorial for learning Swing programming in Java step by step Welcome of our Java Swing tutorial section, here you will find many tutorials
Java Swing Tutorial - Learning Java Swing programming step by step
Tab in Java Set the Color of a Tab in a Tabbed Pane Container in Java...Java Swing tutorial for learning Swing programming in Java step by step Welcome of our Java Swing tutorial section, here you will find many tutorials
Java Swing Tutorial - Learning Java Swing programming step by step
in a Tabbed Pane Container in Java Create a Desktop Pane Container...Java Swing tutorial for learning Swing programming in Java step by step Welcome of our Java Swing tutorial section, here you will find many tutorials
java - Java Beginners
java  Hi, I need the code for swings. How can i get the multiple textarea values from the same tabbed pane. I need the code immediately. Please send the code as soon as possible. Thanks, Valarmathi  Hi Friend
JSF Tutorial and examples
for, Chart Menu Tree Tabbed-pane provided by SUN documentation... start the Tomcat5 with JAVA_HOME= g:\jdk1.5 . Open browser and type the URL.... Tabbed pane: The tabbed pane component is added by using the tag <d:pane
Java Swing Tutorials
and disable any tab in a TabbedPane component of Java Swing. The tabbed... Java Swing Tutorials       Java Swing tutorials -  Here you will find many Java Swing
Change the color of the selected tab
created a tabbed pane and add four tabs to it. The UIManager.put("... void main(String[] args) { JFrame frame = new JFrame("Tabbed Pane Frame...(tab, BorderLayout.CENTER); tab.add("Tab 1", new JLabel("This is Tabbed Pane 1
dhtmlxTabbar
dhtmlxTabbar       This Ajax-enabled JavaScript control provides quick and efficient solution for building dynamic tabbed interface. Different tab positions are supported. Read full
Java server Faces Books
Java server Faces Books         Java server Faces... for years. The technology builds on the experience gained from Java Servlets
JSF EXAMPLES
of jsf1.1 to the webapps folder of tomcat5. Next start tomcat5 server with JAVA_HOME... components along with the link for java and JSP source files. The examples provided are: 1. Image Map 2. Menu or Tree 3. Repeater 4. Scroller 5. Tabbed
java
java  diff bt core java and java
java
java  what is java
JAVA
JAVA  how the name came for java language as "JAVA
java
java   why iterator in java if we for loop
java
java  explain technologies are used in java now days and structure java
java
java  different between java & core java
Java
Java   Whether Java is pure object oriented Language
java
java  is java open source
java
java  what is java reflection
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
java
what is the size of array in java ?  what is the size of array in java ? what is the mean of finalize in java
java
java  give a simple example for inheritance in java
java
java  give a simple example for inheritance in java
java
java  why to set classpath in java

Ads