2011-03-06 41 views
0

所以,我的问题是:当选择“周长”从JComboBox时,我会怎样做,使标签(JTabbedPane的内召开)将显示在最前面?并与区域或其他选项卡类似。将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 
     } 
    } 
} 

回答

0

你可以使用它作为一个展示和不显示选项,这样如果他们选择外线它显示在标签面板的周边信息。

frame.setVisible(true); 

,或者如果你正在寻找把这个标签面板上其他的顶部,你可以尝试: Java Swing - how to show a panel on top of another panel?

相关问题