How to add tabs in right side of a window from top to bottom in swing s

How to add tabs in right side of a window from top to bottom in swing s

How to add tabs in right side of a window from top to bottom in swings

View Answers

July 25, 2012 at 3:46 PM

Here is a code that add tabs in right side of a window from top to bottom in swings.

import javax.swing.*;
import java.awt.*;

public class SetTabLocation extends JPanel {
    public SetTabLocation() {

        this.setLayout(new BorderLayout());
        this.setPreferredSize(new Dimension(400, 200));

        JTabbedPane pane = new JTabbedPane(JTabbedPane.RIGHT);
        pane.addTab("Tab 1", new JPanel().add(new JLabel("This is Tab 1")));
        pane.addTab("Tab 2", new JPanel().add(new JLabel("This is Tab 2")));
        pane.addTab("Tab 3", new JPanel().add(new JLabel("This is Tab 3")));
        this.add(pane, BorderLayout.CENTER);
    }

    public static void main(String[] args) {
        JPanel panel = new SetTabLocation();
        panel.setOpaque(true);
        JFrame frame = new JFrame("JTabbedPane Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setContentPane(panel);
        frame.pack();
        frame.setVisible(true);
    }
}

July 26, 2012 at 3:54 PM

how to add panel in java for any webpage

Ads









Related Tutorials/Questions & Answers:
How to add tabs in right side of a window from top to bottom in swing s
How to add tabs in right side of a window from top to bottom in swing s  How to add tabs in right side of a window from top to bottom in swings
How to add tabs in right side of a window from top to bottom in swing s
How to add tabs in right side of a window from top to bottom in swing s  How to add tabs in right side of a window from top to bottom in swings
Advertisements
how add tabs at the left side of a pane
how add tabs at the left side of a pane  sir i have added the tabs at the top left corner of the pane, but i am unable to add it at the left side of the pane, so please help me
how to print from right to left in java????
how to print from right to left in java????   can anyone pls tell how to print from right to left in java
how to focus on the new window opened from JSF ?
how to focus on the new window opened from JSF ?  Hi guys, I have commandLink with action which using javascript to open a new window(window.open()). Problem is, the new window opens at background behind the current window
GXT Grid moving right side after right alighnment
GXT Grid moving right side after right alighnment  I have created one gxt grid.there are 7 column and last column align as RIGHT .so grid width is moving right side 2px. so how can i fix
uinavigationcontroller add right button
uinavigationcontroller add right button  Hi, How to add the right button programatically to a UINavigation Controller? Thanks   Hi, You can use the following code: - (void)viewDidLoad { [super viewDidLoad
Relative positioning of the child window on top based on the movement of parent window
Relative positioning of the child window on top based on the movement of parent window  Relative positioning of the child window on top based on the movement of parent window
How to add value from sql server in dropdownlist
How to add value from sql server in dropdownlist  I have created a hospital management project using jsp servlet, where one form name is patient... id from other table like out patient, and this id will be stored dynamically
How to run java swing application from jar files .
How to run java swing application from jar files .  Hello Sir, I developed a java swing application .Now i want to execute it as .exe setup file .As per my knowledge i have to run .jar file from dist folder
Passing values from child window to parent window.
Passing values from child window to parent window.  Hai, I'm having a requirement ,in that when i open a (pop-up)child window from a parent window... will have some more values in it.The values which are selected from child window
How to align div side by side?
will explain you how you can align the div side by side using CSS. The CSS... all these div's get aligned side by site. Here is the code of the CSS...; property to align the DIV's side by side. Here is the video tutorial
how to convert php webpage to jpg file/take screenshot from client side
how to convert php webpage to jpg file/take screenshot from client side  how to convert php webpage to jpg file/take screenshot from client side
Passing values from child window to parent window.
Passing values from child window to parent window.  http://www.roseindia.net/java/pass-value-example/pass-value-child-to-parent.shtml I have gone thru the link but my requirement is checkboxes.can u please explain
How to delete and update from Jtable cell in swing app
How to delete and update from Jtable cell in swing app  Hii Sir, I am developing a swing app for adding,updating and deleting from jtable... is getting removed from the jtable but selected row is getting deleted from
how to call the parent page from child without refreshing the parent and my parent window uses the master page
how to call the parent page from child without refreshing the parent and my parent window uses the master page   how to call the parent page from child without refreshing the parent and my parent window uses the master page
How To Pass data from one GUI to another in java swing
How To Pass data from one GUI to another in java swing  I'm new to java and part of our assignment is to build a GUI and display a result set from data input. I'm stuck at how to get the user's input from JTextFields and combobox
how to add data dynamically from database into a dropdown list in a jsp
how to add data dynamically from database into a dropdown list in a jsp  hi friends i am doing a project in jsp and oracle as my database.In my... get dynamically from the database and whenever a new person has registered his
How to add
How to add   Hi, I want to make a website which will recommend users books according to the genre selected by them. I am using PHP, JavaScript... for it? (what Facebook uses for it (Older posts) link in the bottom of every wall
Add Edit And Delete Employee Information
Add Edit and Delete Employee Information Using Swing       In this section, you will learn how to add, edit and delete the Employee's information from the database using java swing
Reversing dojo slider to make it slide from right to left rather left to right as given
on slider must start from right side of the slider so that slider slides from right to left(not from left to right as in given example) how can i reverse...Reversing dojo slider to make it slide from right to left rather left to right
CSS problem height from top
CSS problem height from top  here i wrote a code but can you tell me how to increase height from top <html> <head> <style type="text/css"> .hello img { height : 100px; width :100px; margin-top
Swing JTable which is retrieved from MySQL
Swing JTable which is retrieved from MySQL  How To Display both image and data into Swing JTable which is retrieved from MySQL database
how can i remove newline characters and tabs
how can i remove newline characters and tabs   how can i remove newline characters and tabs ? but i wont to using GUI .please help
Second tab should only show selected products from first tab
;In the javascript, From the comment √Ę‚?¨¬? // live update of how many circles√Ę‚?¨¬...("width","150px"); $('.tabs').tabs(); // live update of how many circles...; li {position: relative; margin-bottom: -1px;} .tabs > li > a {text
How To Display both image and data into Swing JTable which is retrieved from ms access database
How To Display both image and data into Swing JTable which is retrieved from ms access database  So far this is my code how can i display both image and data from database.. while (rs.next()) { Vector row = new Vector(columns
Pass value from child to parent window
Pass value from child to parent window       Java example program to pass value from child window to parent window We can pass values from a child window in Html to the parent
How to Make iPhone Window Application
How to Make iPhone Window Application  Hi, For Making iphone window application, what parameters i have to follow or provide example related to iphone window application. Thanks
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application  Hello Sir, first of all... submit button should show the user various textfields on the same panel from
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application  Hello Sir, first of all... submit button should show the user various textfields on the same panel from
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application  Hello Sir, first of all... submit button should show the user various textfields on the same panel from

Ads