所以,我的问题是:当从 JComboBox 中选择“Perimeter”时,我将如何使选项卡(包含在 JTabbedPane 中)出现在前面?同样使用区域或其他选项卡。
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {
String selectedItem = jComboBox1.getSelectedItem().toString();
if(selectedItem != null)
{
//if perimeter option selected, show the tab for it
if(selectedItem.equals("Perimeter"))
{
//bring the permeter tab to the front, all contained within a tabbedPane
}
if(selectedItem.equals("Area"))
{
//bring the area tab to the front, all contained within a tabbedPane
}
}
}