我正在Netbeans中開發一個小型桌面應用程序。在我的用戶界面我有一個JTabbedPane
有3個選項卡,現在我遇到了一種情況,我需要暫時禁用第二和第三選項卡。我怎樣才能以編程方式做到這一點。現在我使用下面的代碼,但它不工作:NetBeans:如何啓用/禁用JTabedPane中的特定選項卡
int n = jTabbedPane1.indexOfTab("Second Tab Name");// This line returns one as expected
jTabbedPane1.getTabComponentAt(n).enable(false);// but i guess some un-expected thing happens here