2 Replies Latest reply: Aug 22, 2011 3:49 AM by 796227 RSS

    jtabbedpane

    874712
      I have created a tabbedpane and adding multiple instances of single panel to it. But when I try to gettabcount after adding these panels. I am getting tabcount as 1, even though how many panels are added to it.
      Code used to add tab is, class in which this code resides is home.java
       int tableindex = Integer.parseInt(input);
                  BarTable table = new BarTable(tableindex);
                  jTabbedPane1.add(table, "Table" + tableindex);
                 System.out.println("tab count is"+jTabbedPane1.getTabCount());
      console output of this is always correct. It is giving correct number of tabs there are in the tabbed pane,
      But when I call this function from BarTable class, using object of home, it always returns value1. I need to close the selected tab of the multiple tabs in the jtabbedpane. It is giving outof bound error..

      Please help.