What is mean by tab pans ?

What is mean by tab pans ?

In javax.swing package, Using the JTabbedPane class, you can have several components, such as panels, share the same space. 

The user chooses which component to view by selecting the tab corresponding to the desired component. The add() method of JTabbedPane class is used to add container component to the JTabbedPane component of Java Swing.

 Example:import javax.swing.*;import java.awt.*;public class MyTabbedPane{ public static void main(String[] args){ JFrame f = new JFrame(\"My Tabbed Pane Frame\");f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JTabbedPane t = new JTabbedPane(); frame.add(t, BorderLayout.CENTER); JButton b = new JButton(\"1\"); t.add(\"Tab 1\", button); b = new JButton(\"2\"); t.add(\"Tab 2\", button); frame.setSize(300,300); frame.setVisible(true); }}


By:Jalees
Date:2013-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher