JTabbedPane problems

hi,
i have a JTabbedPane and i initialize it with 5 tabs as follows
public class Frame1 extends JFrame
static JTabbedPane jtp= new JTabbedPane();
static JList jl;
static JTextArea jta;
jtp.setBounds(new Rectangle(1, 192, 336, 308));
jtp.setBorder(border16);
jtp.addChangeListener(new mychangelistener());
for(int i = 0; i < 5; i++) //initialising the tabbed pane with 5 tabs
JPanel jp= new JPanel();
jl= new JList();
jta= new JTextArea();
JScrollPane jsp1= new JScrollPane();
JScrollPane jsp2= new JScrollPane();
jp.setLayout(null);
jp.add(jsp1, null);
jp.add(jsp2, null);
jsp1.getViewport().add(jl, null);
jsp1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
jsp1.setBounds(new Rectangle(6, 5, 315, 165));
jsp2.getViewport().add(jta, null);
jsp2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
jsp2.setBounds(new Rectangle(6, 176, 315, 80));
jtp.addTab(tabnames.getText(), jp);
jtp.setEnabledAt(i, false);
class mychangelistener implements ChangeListener
public void stateChanged(ChangeEvent e)
int x = Frame1.jtp.getSelectedIndex();
switch(x)
case 0:
Frame1.jta.append("tab1");
break;
case 1:
Frame1.jta.append("tab2");
break;
the problem i am having is that when tab2 is selected nothing prints in the text area of that tab, it works fine for tab1 tho. i dont think iam referencing the right component by just saying jta.append.. can someone please tell me how to go about doing this?
thanks
maulin

When you post code use the formatting tags so the code is readable. Click on the "Formatting Help" the next time you post a question.
the problem i am having is that when tab2 is selected nothing prints in the text area of that tab, it works fine for tab1 tho.I don't know how it works for tab 1 since the "jta" variable references the last JTextArea created. Why don't you create an array so you can store all five references to the individual text area.

Similar Messages

  • Insert tab in jTabbedPane problem

    Hi,
    I am trying to insert a tab into a JTabbedPane using this method:
    insertTab(String title, Icon icon, Component component, String tip, int index)
    It works fine - the tab is inserted to the right place on the GUI, but the problem is this - though the tab is inserted at the right location in the GUI, when I traverse through the JTabbbedPane, I see that the new tab is inserted at the last index!
    Can someone let me know how to fix this problem?
    Thanks

    Here is the example code:
    import javax.swing.JPanel;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextArea;
    public class TabbedPaneTest {
        public static void main(String[] args) {
            JTabbedPane tp = new JTabbedPane();
            tp.add("tab0", new JPanel());
            tp.add("tab2", new JPanel());
            tp.add("tab3", new JPanel());
            tp.insertTab("tab1", null, new JTextArea(), null, 1);
            for (int i=0; i<tp.getComponentCount(); i++) {
                System.out.println("TabComponent"+i+": "+tp.getComponent(i));
    }The output of this test program is:
    TabComponent0: javax.swing.JPanel...
    TabComponent1: javax.swing.JPanel...
    TabComponent2: javax.swing.JPanel...
    TabComponent3: javax.swing.JTextArea...
    You can see that the JTextArea is not inserted at index 1 as expected.
    But I found the solution for this problem myself. If you replace tp.getComponent(i) by
    tp.getComponentAt(i) the program output is:
    TabComponent0: javax.swing.JPanel...
    TabComponent1: javax.swing.JTextArea...
    TabComponent2: javax.swing.JPanel...
    TabComponent3: javax.swing.JPanel...
    and this is what I need!!!

  • Swing JTabbedPane problem!!!!!!!!

    hi guys
    i create the UI by GUI builder of NetBeans IDE. i want to add two JPanels in JTabbedPane. But the everytime i drag the JPanel into JTabbedPane. NetBeans will generate the code and arrange two JPanels by GroupLayout. i dont want to have GroupLayout to mange the these two JPanels in JTabbedPane.
    Also i know i to do it by coding manually. But I want to execute in NetBeans. Is there any properties i have to change in Netbeans.
    thanks in advance

    I'm currently running jdk1.6.0, although the problem occurred while running on jdk1.5.x as well. It should be noted that I'm running this on Linux, using the official JDK from Sun (not gcj or anything of the sort). The application is written in pure Swing, no AWT canvases etc. Thus far, all testing has been performed exclusively on Linux and in all cases the results have been the same (I've tested with at least 2 distributions: Slackware and Mandriva 2007).
    As for development tools, the problem occurs both with the new Netbeans 5.5 (and possibly older versions, though I haven't checked) as well as eclipse running the MyEclipseIDE plugin which contains a port of the Netbeans Matisse GUI development framework. While it is possible the IDEs are generating poor code, I doubt that is the problem.
    I'll need to set up a Windows box and try it out on that. If the problem still occurs, I'll write a minimal program to replicate the problem and post it here.
    Thanks for the replies

  • JTabbedPane problem! its urgetnt

    this is the tabbedpanel i wanted to create but has some problem..
    the connected panels dont show their content.
    the tabbed panel shows but the linked panels dont.
    wats the prob wid it!!
    public class tabbedpane extends JApplet
    public void init()
    JTabbedPane jtp=new JTabbedPane();
    jtp.addTab("searchbook",new searchbook());
    jtp.addTab("searchmember",new searchmember());
    getContentPane().add(jtp);
    class searchbook extends JPanel
    public searchbook()
    setLayout(null);
    JTextfield txt1=new JTextField();
    setBounds(40,40,120,20);
    add(txt1);
    JRadioButton rb1=new JRadioButton("by name");
    setBounds(40,60,60,20);
    add(rb1);
    JRadioButton rb2=new JRadioButton("by author");
    setBounds(40,80,60,20);
    add(rb2);
    class searchmember extends JPanel
    public searchmember()
    setLayout(null);
    JTextfield txt2=new JTextField();
    setBounds(40,40,120,20);
    add(txt2);
    JRadioButton rb1=new JRadioButton("by id");
    setBounds(40,60,60,20);
    add(rb1);
    JRadioButton rb2=new JRadioButton("by name");
    setBounds(40,80,60,20);
    add(rb2);
    plz help!!!very urgent......

    take a look at the constructors of the classes searchbook and searchmember
    when basicaly you have multipls of following code
    Component comp = someComponent();
    setBounds(blah, blah, blah...);
    add(comp);the problem is in the set bounds call you are setting the bounds of the container not the component so the code should be corrected as
    Component comp = someComponent();
    comp.setBounds(blah, blah, blah...);
    add(comp);And please use code tags when you post codes. It is very deficult to read the code without them fortunetly for you I was in a strange mode so I read your code and that will not happen next time

  • JTabbedPane problem

    Hi all,
    I'am trying to do a swing xml editor.My editor have undo/redo function.I use JTabbedPane because i want the user to be able to open multiple file :
    undobutton | redobutton +('this are undo redo buttons with ActionListener ;buttons are not include in JTabbedPane obj')+
    file1.xml | file2.xml | file3.xml +("this is my JTabbedPane")+
    Let say i wrote smth. in all files above,and later file1.xml is selected :If i push undobutton it makes changes in all three files,but i want to undo content only in file1.xml

    It's looking like you're creating a CompoundUndoManager for each text pane, and then adding each CompoundUndoManager's undo and redo actions to your buttons as listeners. Thus each time you click one of the buttons, all of the undo (or redo) actions for all text panes will be notified.
    If you have multiple editors in an application, and a toolbar with an "undo" and "redo" button, you should probably add a TextAction to each button that determines the text component that is currently active (TextAction provides methods to do so), then grab that text component's UndoManager and have it undo/redo. That way you're only ever undo/redoing stuff on the currently active text component.
    If you need further help, you'll have to post an SSCCE. Note that an SSCCE is not just a code snippet of your current application.

  • JTabbedPane problem.Please help

    I have a main class that extends a Frame and this
    main class has a JTabbedPane which has the
    statement:
    tabbedPane.addTab
    ("One",
    null,
    new A(),
    null);
    But the contents of class A is not displayed.
    Class A extends JPanel.
    Is there the show() or repaint() I need to call in the
    Constructor of A?

    Hello what LayoutManager did you specify ..?
    you can use GridBagLayout which you will have to specify your layout process or just simply use BorderLayout which is the default Layout Manager for JPanel.
    APanel.add (p1, BorderLayout.NORTH);
    APanel.add (p2, BorderLayout.CENTER);
    APanel.add (p3, BorderLayout.SOUTH);
    Hope this works.

  • JTappedPane with the Same component

    Hi,
    I know that itsn't possible to put the same component in different tabs of a JTabbedPane, but i must perform this for my application, let say that i have a componenet similar to a JTable on which i can't perform all controls , only to change it's data, and I must put the same object into JTappbedPane and when selecting a tab the componenent change it's data according to the selected tab.
    can any one help me to skip the JTabbedpane problem and implement this.
    thanks in advance.
    Regards,

    From what I can see, you want to have some similar features with the table component in all the tabs. What I think you can do is to create some static fields in the table component which you'll use to store information for the table. Then in each tab create a new instance of the table component, and pass in the required data to be displayed. The static fields will be shared between the table components. That way if you have to call some data retrieval method, you only have to call the it one of the table components to get all the data for the other instances.
    This will save you from having to listen to the tabs for which is selected and then change the table display.

  • JTabbedPane with FormLayout problems

    I created form which contain JTabbedPane within JPanel with FormLayout. In the JTabbedPane, I put JPanel with FormLayout. In Design Mode, there is nothing problem, I can put whatever item into the JPanel of JTabbedPane. But in Runtime Mode, JTabbedPane display nothing, many items I've put on it are not displayed. But when I change the Layout into another like XY Layout or FlowLayout, items are displayed correctly.
    any idea to solve this?
    and why JDeveloper doesn't implement SpringLayout?

    Hi user567546, i faced the same problem.
    Fortunately, I solved it by using PanelBuilder instead of Panel,
    take a look at this example:
    http://www.java2s.com/Code/Java/Swing-Components/DemonstratesthebasicFormLayoutsizesconstantminimumpreferred.htm
    Regards,
    Luis R.

  • Layout problem with JTabbedPane

    Hi,
    I'm creating a JDialog with a JOptionPane in it which has a JTabbedPane as its ContentPane
    Supposed to look like the pic below. I've put the JOptionPane into a JScrollPane in case the user makes the Dialog too small.
    Problem is that the JTabbedPane stretches to a very large height (way bigger than the dialog height).
    Using setPreferredSIze(..) on the JTabbedPane doesn't help either. If the dialog is made bigger, then the TAbbedPane doesn't stretch, if it is made smaller, the TabbedPane shrinks to the minimum necessary size.
    Any ideas, tips on getting this layout would be appreciated.
    |                                      |/\|
    |  ----- -----                         |--|
    |  |   | |   |                         |  |
    | -----------------------------------  |  |
    | |                                 |  |  |
    | |  2 Tables and several buttons   |  |__|
    | |  on this JTabbedPane using      |  |  |
    | |  GridBagLayout                  |  |__|
    | |                                 |  |  |
    | -----------------------------------  |  |
    |                                      |  |
    |          | OK | | Cancel |           |--|
    |                                      |\/|
    -------------------------------------------

    Check this: http://forum.java.sun.com/thread.jsp?forum=57&thread=293587
    - ananth
    Hi,
    I'm creating a JDialog with a JOptionPane in it which
    has a JTabbedPane as its ContentPane
    Supposed to look like the pic below. I've put the
    JOptionPane into a JScrollPane in case the user makes
    the Dialog too small.
    Problem is that the JTabbedPane stretches to a very
    large height (way bigger than the dialog height).
    Using setPreferredSIze(..) on the JTabbedPane doesn't
    help either. If the dialog is made bigger, then the
    TAbbedPane doesn't stretch, if it is made smaller, the
    TabbedPane shrinks to the minimum necessary size.
    Any ideas, tips on getting this layout would be
    appreciated.
    |                                      |/\|
    |  ----- -----                         |--|
    |  |   | |   |                         |  |
    | -----------------------------------  |  |
    | |                                 |  |  |
    | |  2 Tables and several buttons   |  |__|
    | |  on this JTabbedPane using      |  |  |
    | |  GridBagLayout                  |  |__|
    | |                                 |  |  |
    | -----------------------------------  |  |
    |                                      |  |
    |          | OK | | Cancel |           |--|
    |                                      |\/|

  • JTabbedPane, JPane PROBLEM

    Hi!, I have a several problem with JApplet, this is the code:
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.io.*;
    import java.awt.*;
    public class NuevoApplet extends JApplet{
    JMenuBar menuBar;
    JMenu menuArchivo, submenu;
    JMenuItem menuNuevo;
    JTabbedPane Tabbed1 = new JTabbedPane();
    JPanel Panel = new JPanel();
    class EventHandler implements ActionListener
              public void actionPerformed(ActionEvent e)
                   //Si se elige salir en el menu
                   if (e.getSource() == menuNuevo)
                        CreaTab();
    ActionListener eventHandler = new EventHandler();
    public void start(){}
    public void init () {
    try {
    UIManager.setLookAndFeel(new com.sun.java.swing.plaf.windows.WindowsLookAndFeel());
    } catch (Exception e) { }
    Panel.setBorder(BorderFactory.createEtchedBorder());
    Panel.setLayout(new java.awt.BorderLayout());
    this.Panel.updateUI();
    this.setContentPane(this.Panel);
    this.CreaMenus();
    this.getContentPane().add(this.Tabbed1,java.awt.BorderLayout.CENTER);
    initConnections();
    private void CreaMenus(){
    //Creamos la barra de men�s
    menuBar = new JMenuBar();
    this.setJMenuBar(menuBar);
    //Creamos el men� de Archivo
    menuArchivo = new JMenu("Archivo");
    menuBar.add(menuArchivo);
    //Creamos los elementos del men� archivo
    menuNuevo = new JMenuItem("Abrir Archivo *.hex");
    menuArchivo.add(menuNuevo);     
    public void initConnections()
    //se suscriben todas las componentes que quieren escuchar los eventos
         menuNuevo.addActionListener(eventHandler);
    public void CreaTab(){
    JPanel a = new JPanel();
    Entorno1 b = new Entorno1();
    a.add(new JButton("BOTON1"),java.awt.BorderLayout.CENTER);
    a.add(new JButton("BOTON2"),java.awt.BorderLayout.EAST);
    this.Tabbed1.addTab("Primera Pesta�a", b); --> PROBLEM, not insert the JPanel b extends Entorno1
         b.repaint();
         Tabbed1.invalidate();
    Tabbed1.getParent().invalidate();
    Tabbed1.validate();
    Tabbed1.repaint();
         this.Tabbed1.updateUI();
         /*this.Tabbed1.validate();
         this.Tabbed1.updateUI();
         this.Tabbed1.revalidate();*/
    public class Entorno1 extends JPanel{
    public void Entorno1(){
         setLayout(new BorderLayout());
         Border raisedBevel = BorderFactory.createRaisedBevelBorder();
    Border loweredBevel = BorderFactory.createLoweredBevelBorder();
    Border compound = BorderFactory.createCompoundBorder
    (raisedBevel, loweredBevel);
    this.setBorder(compound);
    this.add(new JButton("Boton1"),java.awt.BorderLayout.CENTER);
    this.add(new JButton("Boton2"),java.awt.BorderLayout.EAST);
    this.updateUI();
    this.setVisible(true);
    this.revalidate();
    this.repaint();
    } //Fin de la clase Applet16F84
    When I use b extends Entorno1 and I insert as JPanel of JTabbedPane, not show it.
    this.Tabbed1.addTab("Primera Pesta�a", b);
    But this yes show it:
    this.Tabbed1.addTab("Primera Pesta�a", a);
    Why ? ..
    Thanks !

    Your constructor is actually a method and not a constructor.
    Therefore calling new Entorno1() returns you a blank panel.
    change this
    public void Entorno1(){
    ...to this.
    public Entorno1(){that should do it..
    nes

  • Problem with scroll tab layout in JtabbedPane

    Pls. if anyone know this, help me
    I have a problem, my scroll tab layout policy does not working when I set it to UI.
    import javax.swing.*;
    import javax.swing.plaf.basic.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.plaf.*;
    public class Components_Area extends JFrame{
         JTabbedPane tab = new JTabbedPane(JTabbedPane.TOP,JTabbedPane.SCROLL_TAB_LAYOUT);
         JLabel l[] = new JLabel[5];
        public Components_Area() {
              tab.setUI(new TestPlaf());
              tab.addTab("Untitled",l[0]);
              tab.addTab("Untitled",l[1]);
              tab.addTab("Untitled",l[2]);
              tab.addTab("Untitled",l[3]);
              tab.addTab("Untitled",l[4]);
              getContentPane().add(tab);
        public static void main(String args []) {
             Components_Area frame = new Components_Area();
             frame.setSize(200,200);
             frame.show();
         static class TestPlaf extends BasicTabbedPaneUI {
              protected LayoutManager createLayoutManager() {
                   return new TestPlafLayout();
              protected Insets getTabInsets(int tabPlacement,int tabIndex) {               
                   Insets defaultInsets = (Insets)super.getTabInsets(tabPlacement,tabIndex).clone();
                   defaultInsets.right += 50;
                   defaultInsets.top += 2;                
                   return defaultInsets;
              class TestPlafLayout extends TabbedPaneLayout {
                   //a list of our close buttons
                   java.util.ArrayList closeButtons = new java.util.ArrayList();
                   public void layoutContainer(Container parent) {
                        super.layoutContainer(parent);
                        //ensure that there are at least as many close buttons as tabs
                        while(tabPane.getTabCount() > closeButtons.size()) {
                             closeButtons.add(new CloseButton(closeButtons.size()));
                        tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
                        Rectangle rect = new Rectangle();
                        int i;
                        for(i = 0; i < tabPane.getTabCount();i++) {
                             rect = getTabBounds(i,rect);
                             JButton closeButton = (JButton)closeButtons.get(i);
                             //shift the close button 3 down from the top of the pane and 20 to the left
                             closeButton.setLocation(rect.x+rect.width-20,rect.y+4);
                             closeButton.setSize(15,15);
                             tabPane.add(closeButton);
                        for(;i < closeButtons.size();i++) {
                             //remove any extra close buttons
                             tabPane.remove((JButton)closeButtons.get(i));
                   // implement UIResource so that when we add this button to the 
                   // tabbedpane, it doesn't try to make a tab for it!
                   class CloseButton extends JButton implements javax.swing.plaf.UIResource {
                        public CloseButton(int index) {
                             super(new CloseButtonAction(index));
                             setBorder( BorderFactory.createEmptyBorder() );
                        setToolTipText("Close this tab");
                             //remove the typical padding for the button
                             setMargin(new Insets(0,0,0,0));
                        addMouseListener(new MouseAdapter() {
                                  public void mouseEntered(MouseEvent e) {                           
                                   setBorder( BorderFactory.createLineBorder(Color.black, 1 ));
                                 public void mouseExited(MouseEvent e) {                                
                                      setBorder( BorderFactory.createEmptyBorder() );
                   class CloseButtonAction extends AbstractAction {
                        int index;
                        public CloseButtonAction(int index)     {
                             super("x");
                             this.index = index;
                        public void actionPerformed(ActionEvent e) {
                             tabPane.remove(index);
    }     Message was edited by:
    henyo

    If someone knows this, help me!

  • Problem of getting event in the jTabbedPane

    Hi,
    I have problem to do a jTextField.setText(), or jTextField.getText() from a jTabbedPane.
    I create a jTabbedPane and have 7 jPanel in it. For the fifth jPanel, all jTextField in there works normally, but for the 6th and 7th one, all jTextField in there doesn't work.
    When I call getText(), I can alwys get "", and when I call setText(), I cannot see any update in the jTextField, even I can know that the content is actually changed. However, I can still capture the event on this 6th and 7th panel.
    Thanks for help!
    Nachi

    There seem to be quite a lot of quotes in the example above.
    My guess is that it works in the manual login because the shell does concatenate some of the escape characters.
    In a Java program, you should not need that amount of escaping...
    Regards,
    Ludovic.

  • JTabbedPane and JScrollPane problem

    Hi all,
    I'm trying to make working JScrollPane into JTabbedPane. I have been trying several times to make it but with no acceptable effects :( I attached below the simple code to show what I'm interested in.
    PANEL1 has its dimension. I'd like to make that the JScrollPane will be active and enabled to roll when user change JFrame size to less than PANEL1 on pane1.
    Please help!
    Thanks for everyone,
    Greetings,
    import java.lang.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class Sample     {
    static JFrame fr;
    static JPanel pane1, pane2, pane3;
    static JLabel AAA, BBB, CCC;
    static JPanel PANEL1;
    static JTabbedPane panel;
    public static void main(String args[])     {
              fr = new JFrame("Sample");
              pane1 = new JPanel();
              pane1.setLayout(null);
              pane2 = new JPanel();
              pane2.setLayout(null);
              pane3 = new JPanel();
              pane3.setLayout(null);
              panel = new JTabbedPane();
              Font myfont1 = new Font("SansSerif",0,20);
              Font myfont2 = new Font("SansSerif",0,15);
              Font myfont3 = new Font("SensSerif",1,15);
              AAA = new JLabel("AAA");
              BBB = new JLabel("BBB");
              CCC = new JLabel("CCC");
              AAA.setFont(myfont2);
              BBB.setFont(myfont2);
              CCC.setFont(myfont2);
              AAA.setBounds(20,20,300,20);
              BBB.setBounds(20,50,300,20);
              CCC.setBounds(20,80,300,20);
              PANEL1 = new JPanel();
              PANEL1.setLayout(null);
              PANEL1.setBackground(java.awt.Color.CYAN);
              PANEL1.setBounds(20,15,250,300);
              PANEL1.add(AAA);
              PANEL1.add(BBB);
              PANEL1.add(CCC);
              pane1.add(PANEL1);
              panel.insertTab("A", null, pane1, null, 0);
              panel.setSelectedIndex(0);
              panel.insertTab("B", null, pane2, null, 1);
              panel.setSelectedIndex(0);
              panel.insertTab("C", null, pane3, null, 2);
              panel.setSelectedIndex(0);
              panel.setBounds(0,0,550,450);
              fr.setLayout(null);
              //fr.setResizable(false);
              fr.setBackground(java.awt.Color.CYAN);
              fr.setForeground(java.awt.Color.CYAN);
              fr.add(panel);
              fr.pack();
              fr.setSize(550, 450);
              fr.setLocationRelativeTo(null);
              fr.setVisible(true);
    }

    Unfortunately no :( Besides, I can't understand at
    all this line:
    JTabbedPane (panel)TabbedPane = ... new
    w JTabbedPane(...).add/insertTab( ... new
    JScrollPane(new JPanel(...)) ... )It's to big cut-off like for me. Can you insert it
    into my Sample?
    Regards and thanks,It's only my "dev speak". Put a ";" and a var name (, ...) whereever needed, and remove some"()".
    (Sorry, normally I don't help dev beginners on so more complex problems, with just an easy answer.)

  • JFrame.pack() causes problems with jtabbedpane(making new tabs)and resizing

    I have a JFrame with a JTabbedPane inside of it. Inside of each tab I put a JPanel with a JTextArea in it. When I create a new tab, I do something like textArea.requestFocusInWindow();
    However, this will not work unless I do a frame.pack() right after I created the new tab and right before that line of code.
    This in turn causes another problem. If I resize the jframe and then create a new tab, the window will snap back to the size it had before creating the tab. I assume this has to do with the pack() function, however nothing else I try will make the cursor blink in the JTextArea.
    Is there a solution to this...either something to make the cursor blink or something other than the pack function to update the JFrame?
    Thank you

    This posting should help you out:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=581478

  • Problem using a JTabbedPane in my application

    Hello, everybody.
    I am developping a application using the GUI editor NetBeans IDE 3.6 and I have some questions-problems.
    I encounter some problems with my JTabbedpane used in my application. I use a JTabbedPane with seven JPanel. On the first JPanel, I have some different components (JLabel, JComboBox, JTextField, JButton, List, ...) and it does not create any problem when I start my apllication.
    On the second JPanel of the JTabbedPane used, I separeted it with some other JPanel to differenciate the types of data's displayed in that tab and I also have a lot of different components on it ((JLabel, JComboBox, JTextField, JButton, List, ...).
    My first problem is that, when I start my application, the List component on the second Jpanel of my JTabbedPane appears above all the other tabs of my JTabbedPane until I click on the tab that contains that List. Once I have clicked on the second JPanel (that contains the List that makes me some problems), everythings becomes OK and it does not appear anymore above the other tabs (JPanel) of my JTabbedPane. I thing that it is a question a properties wrongly set, but I don't know the one I have to correct to eliminate that probem.
    The second problem is how to go from one JPanel (tab) to another JPanel (tab)with programming ??? For example, I would like to go to the second JPanel (tab) while double-clicking on a record present in a List in the first JPanel(tab). How can I do that ???
    A great thank you in advance for your help.
    Christian.

    For the seconds question, use the method setSelectedIndex() or setSelectedComponent(), whichever is more appropriate.
    The first problem I have also seen sometimes with tabbed panes. Can't remember how I corrected it though. Guess you could make sure the panels backgrounds are set to be opaque.

Maybe you are looking for