Thread: combobox
View Single Post
  #3 (permalink)  
Old 07-02-2008, 10:36 PM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
Code:
String[] items = { "Login", "Logout" ... }; String[] urls = { "urlOne", "urlTwo" ... }; JComboBox combo = new JComboBox(items); combo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int index = ((JComboBox)e.getSource()).getSelectedIndex(); String urlStr = urls[index]; // carry on
Reply With Quote