Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jtabbedpane

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 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.

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 19 2011
Added on Aug 22 2011
2 comments
664 views