Forum Stats

  • 3,852,417 Users
  • 2,264,102 Discussions
  • 7,905,063 Comments

Discussions

jtabbedpane

874712
874712 Member Posts: 5
edited Aug 22, 2011 4:49AM in Java Desktop Applications
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.

Answers

This discussion has been closed.