我正在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