Skip to Main Content


874712Aug 22 2011 — edited Aug 22 2011
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
 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.
Post Details
Added on Aug 22 2011