passing value from jcombobox to other classes?
Hi guys,
I have an Jcombobox with an actionlistener set up in a class called "boxSelected", so that when the user clicks on the choice they're after the result is sent to a jtext area.
publicclass box2listenerimplements ActionListener{
publicvoid actionPerformed(ActionEvent e){
if(e.getSource()==queryBox2){
int selectedIndex = queryBox2.getSelectedIndex();
String box2Selected = queryBox2.getSelectedItem().toString();
System.out.println("Selected: "+box2Selected);
String newline ="\n";
textArea3.append(box2Selected + newline);
}
}
};
The class with the actionlistener is contained within another class, one called Editor.
My question is, can I pass this new string value, boxSelected, for use in another class? I'm trying to create a new .java file and pass this string value for use with a class there, so I can parse it into some queries.
I've been at this a wee while and am still very new. Thanks for any help or code you could give me here to sort this, any help would be great.

