And why do you want to return the box selected pray tell. -------------------------------------------
There are no onions, only magic
-------------------------------------------
If I understand you correct then I guess you want to know which combobox you actually selected from.
Implement a actionlistener...
public class mybox implement java.awt.eveny.ActionLister extends JFrame
{
JComboBox box = new JComboBox();
box.addActionListener(this);
//This method also handles both components
public void actionPerformed(ActionEvent e)
{
//This tells you which combobox you are selection..
if (e.getSource() ==box)
{
//add code here
}
}
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.