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

Ads

 
 

Share on Google+Share on Google+

raveen
How to add tabs in right side of a window from top to bottom in swing s
2 Answer(s)      5 years and 2 months ago
Posted in : Swing AWT

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

Ads
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
TRIANGLE OF *S AT THE BOTTOM RIGHT!!! - Java Beginners
TRIANGLE OF *S AT THE BOTTOM RIGHT!!!  My Question is to : "Write... with the right angle at the bottom-right." PROBLEM: Have tried so many times to make the triangle at the right side but couldn't do so. Can you please solve
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
The Window Event - Swing AWT
; } } }); add(exit_button); setVisible(true); setSize(100, 50); setTitle("Window...The Window Event  hey plz i need help here... plz modify..." or "no" and proceed as selected from these options.. thank you.. import
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 add the two tables in same row when generating pdf file from jsp - JSP-Servlet
how to add the two tables in same row when generating pdf file from jsp  How to add the two tables in same row one is left side and other is right side please help me.   Hi Friend, Try the following code
How to open a window from a java program (from code)[ (onclick of something text )]
How to open a window from a java program (from code)[ (onclick of something text )]  When I download the code an put it in Eclipse, the applet is run, but on click of the button displayed in the applet, a new window with google
Window State - Swing AWT
Window State  Thanks for you reply. I have already tried the setSize() method of AWT Window and also with JFrame. But I want to Maximize the Window when it is opened by the user and instead of the Maximize
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
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 delete records from jtabel - Swing AWT
How to delete records from jtabel  hello I am using jtabel.... It is working properly.but now i want to delete rows from tabel at a time one row...); } } ------------------------------ read for more information, http://www.roseindia.net/java/example/java/swing
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 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 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
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
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 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
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
jQuery UI Tabs
jQuery UI Tabs In this section, you will learn about UI tabs .For using UI tabs you need add "jquery-ui-1.8.4.custom.min.js" plug-in in your html.../javascript"> $(function() { $("#tabs").tabs(); }); </script>
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
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
How to retrive an inmage from database and displaying it in imgae box - Swing AWT
How to retrive an inmage from database and displaying it in imgae box  hello Can you plz tell is there any imagebox related option in java swing? I want to retrive an image from database and to display it in a small imagebox
how to add Arraylist filter for a jsp page showing results from a servlet
how to add Arraylist filter for a jsp page showing results from a servlet ... page table of given contents of database, i want to add a filter to it to show only the matched contents from list, the table which is coming out
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
JDOM Element Example, How to add and remove child from xml file.
JDOM Element Example, How to add and remove child from xml file. In this tutorial, we will see how to add and remove child node in an xml Document tree. We can add child any where in xml document tree with the help of JDOM API

Ads

 
Advertisement null

Ads