2012-06-29 2 views

ответ

1

как SoboLAN сказал:

final JTabbedPane tabs = new JTabbedPane(); 
    JPanel panel = new JPanel(); 
    tabs.add("title", panel); 
    //add more tabs... 

    // here the important part starts 
    JMenuItem item = new JMenuItem("open tab 1"); 
    item.addActionListener(new ActionListener() { 
     //this function get called when you click the item. 
     @Override 
     public void actionPerformed(ActionEvent e) { 
      //insert the index you want to select 
      tabs.setSelectedIndex(0); 
     } 
    }); 

 Смежные вопросы

  • Нет связанных вопросов^_^