Home Answers Viewqa Java-Beginners JAVA SWING JTabbedPane

 
 


Jun
JAVA SWING JTabbedPane
1 Answer(s)      5 years and a month ago
Posted in : Java Beginners

View Answers

May 20, 2008 at 3:06 PM


Hi friend,

import javax.swing.*;
import javax.swing.JTabbedPane;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JFrame;

import java.awt.*;
import java.awt.event.*;

public class JTabbedPaneexam extends JPanel {
public JTabbedPaneexam() {
ImageIcon icon = new ImageIcon("/home/vinod/amarexamples/valentinstag_herz_rose.gif");
JTabbedPane tabbedPane = new JTabbedPane();

Component panel1 = makeTextPanel("Java Tutorial");
tabbedPane.addTab("One", icon, panel1, "Does nothing");
tabbedPane.setSelectedIndex(0);

Component panel2 = makeTextPanel("Java, JavaScript,JSP");
tabbedPane.addTab("Two", icon, panel2, "Does twice as much nothing");

Component panel3 = makeTextPanel("Java, Servlet JSP Struts2.0 ");
tabbedPane.addTab("Three", icon, panel3, "Still something else");

Component panel4 = makeTextPanel("Java, Servlet JSP Struts2.0 HTML ");
tabbedPane.addTab("Four", icon, panel4, "Now click get more title");

//Add the tabbed pane to this panel.
setLayout(new GridLayout(1, 1));
add(tabbedPane);
}

private Component makeTextPanel(String text) {
JPanel panel = new JPanel(false);
JLabel lable = new JLabel(text);
lable.setHorizontalAlignment(JLabel.CENTER);
panel.setLayout(new GridLayout(1, 1));
panel.add(lable);
return panel;
}

public static void main(String[] args) {
JFrame frame = new JFrame("Jtabbed pane example");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e){
System.exit(0);
}
});

frame.getContentPane().add(new JTabbedPaneexam(), BorderLayout.CENTER);
frame.setSize(400, 250);
frame.setVisible(true);
}
}


--------------------------------------------------------

read for more information.

http://www.roseindia.net/java/









Related Pages:
jtabbedpane
jtabbedpane  how to add a close button in jtabbed pane using java swing
jtabbedpane
jtabbedpane  How to add jtextfield or jtabbedpane by coding using java netbeans?? plzz help
JAVA SWING JTabbedPane - Java Beginners
JAVA SWING JTabbedPane  Hi all, I would like to ask a question about how to place a tab in JTabbedPane in the middle rather than from left..."); JTabbedPane tabbedPane = new JTabbedPane(); Component panel1
Creating a JTabbedPane Container in Java Swing
Creating a JTabbedPane Container in Java Swing  ... to create the JTabbedPane container in Java Swing. The example for illustration... the JTabbedPane component of Java Swing: These are explained as follows
java JTabbedPane() - Java Beginners
java JTabbedPane()  how to add layout manager in JTabbedPane() plese...://www.roseindia.net/java/example/java/swing/ Thanks. Amardeep... { private JTabbedPane tabbedPane; private JPanel panel1; private JPanel panel2
JTabbedPane
Java: JTabbedPane Description. The JTabbedPane container allows many.... Constructor JTabbedPane tp = new JTabbedPane(); // Tabs along the top edge. JTabbedPane tp = new JTabbedPane(edge); Where edge specifies which edge
Jtabbedpane - Java Beginners
Jtabbedpane  JTabbedPane and i have no idea how to intract with the user by this button. So...;Java Example for adding abstarct JButton in JTabbedPane and interacting with user...); JTabbedPane tab = new JTabbedPane(); frame.add
SWING
SWING  A JAVA CODE OF MOVING TRAIN IN SWING
swing
swing  Write a java swing program to delete a selected record from a table
Sitemap Java Swing Tutorial
-to-One Relationship | JPA-QL Queries Java Swing Tutorial Section Java Swing Introduction | Java 2D API | Data Transfer in Java Swing | Internationalization in Java Swing | Localization | What is java swing
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
Java JTabbedPane Example
Java JTabbedPane Example In this section we will discuss about how to add... onto the frame in Java. Using tab user can switch to one component to another... components on each tabs. For this I have created a Java Class named
swing - Swing AWT
swing   how to create JTabbedPane.when i choose one jtabbedpane it will appear JTextField,resultMessages.pls give me any examples  Hi...(JFrame.EXIT_ON_CLOSE); JTabbedPane tab = new JTabbedPane(); frame.add
java swing - Swing AWT
java swing  how i can insert multiple cive me exampleolumn and row in one JList in swing?plz g  Hi Friend, Please clarify your question. Thanks
Java swing
Java swing  what are the root classes of all classes in swing
Java swing
Java swing  Does Swing contains any heavy weight component
java swing
java swing  view the book details using swing
java swing
java swing  what is java swing   Swing is a principal GUI toolkit for the Java programming language. It is a part of the JFC (Java Foundation Classes), which is an API for providing a graphical user interface for Java
java swing
java swing  how to connect database with in grid view in java swing   Hi Friend, Please visit the following link: Grid view in java swing Thanks
Java Swing Tutorials
how to create the JTabbedPane container in Java Swing. The example... Java Swing Tutorials       Java Swing tutorials -  Here you will find many Java Swing
java swing - Swing AWT
java swing  how to add image in JPanel in Swing?  Hi Friend, Try the following code: import java.awt.*; import java.awt.image....: http://www.roseindia.net/java/example/java/swing/ Thanks
java swing
java swing  add two integer variables and display the sum of them using java swing
Java swing
Java swing  Write a java swing program to calculate the age from given date of birth
java swing - Swing AWT
java swing   how i can insert in JFrame in swing?  Hi Friend, Try the following code: import java.awt.*; import javax.swing.*; import java.awt.event.*; class FormDemo extends JFrame { JButton ADD; JPanel
java swing - Swing AWT
java swing   Iam developing a java web browser.Actually my code works fine ie. i can load a web page without proxy.But in my place i have only proxy... a proxy or how to make my java web browser to listen to proxy setting??? please help
java swing.
java swing.  Hi How SetBounds is used in java programs.The values in the setBounds refer to what? ie for example setBounds(30,30,30,30) and in that the four 30's refer to what
What is Java Swing?
What is Java Swing?       Here, you will know about the Java swing. The Java Swing provides... and GUIs components. All Java Swing classes imports form the import
Java swing
are displayed in the table..I need the source code in java swing...Java swing  If i am login to open my account the textfield,textarea and button are displayed. if i am entering the time of the textfield
Java swing
to the database using java swing...Java swing  I create one table. That table contains task ID and Task Name. When I click the task ID one more table will be open and that table
java swing - Swing AWT
java swing  how to save data in sql 2005 while insert in textfield  Hi Friend, Try the following code: import java.sql.*; import javax.swing.*; import javax.swing.border.*; import java.awt.*; import
java - Swing AWT
What is Java Swing AWT  What is Java Swing AWT
swing program
swing program  Iam using one JFrame and 4 JPanels one JTabbedPane. my problem is next, previous buttons. when click next button visible some JPanels,again press visble another JPanels. also previous button. how to write the logic
Java swing
Java swing  how to create simple addition program using java swing?   import java.awt.*; import javax.swing.*; import java.awt.event.*; class SumOfNumbers extends JFrame { SumOfNumbers(){ JLabel lab1=new
swing - Java Beginners
Swing application testing  What are the conventions for testing a Java swing application
Swing Program
Swing Program  Write a java swing program to calculate the age from given date of birth
Swing paint - Swing AWT
the Swing Applet, use html file with the following code: Java Applet Demo...Swing paint  hi, i want to print something on window using swing applet.. m doing dis.. protected void paintComponent(Graphics g
Java swing
Java swing  when i enter the time into the textbox and activities into the textarea the datas saved into the database.the java swing code for the above item   import java.sql.*; import java.awt.*; import javax.swing.
Java swing
Java swing  How to combine two java files
java swing
java swing  meaning of out.flush
java swing
java swing  what is code for diplay on java swing internal frame form MYSQL DB pls send   Here is a code of creating form on jinternalframe and connect to mysql. import java.io.*; import java.sql.*; import java.awt.
swing program
swing program  Write a java swing program to getname and email id. Display the message if email id contains the name of theuser
Java swing
Java swing  What method is used to specify a container's layout
Java swing
Java swing  What methods are used to get and set the text label displayed by a Button object
Java Swing
Java Swing  I want scroll bar in a frame is it possible? if it is possible means i want coding for that please send me a reply
java swing
java swing  iam using my project text box, label , combobox and that the same time i want menubar and popmenu. plz give me code for this. i want immediately plz send me that code
java swing
java swing  iam using my project text box, label , combobox and that the same time i want menubar and popmenu. plz give me code for this. i want immediately plz send me that code
Java Swing
Java Swing  i have a Label more than that of a frame .... how to extend the frame to view the label which are hidden.. please send me the coding sir/madam
Java Swing
Java Swing  i have a Label more than that of a frame .... how to extend the frame to view the label which are hidden.. please send me the coding sir/madam
Java Swing
Java Swing   i have a Label more than that of a frame .... how to extend the frame to view the label which are hidden.. please send me the answer sir/madam