I have one quetsion about java actionlistener
here is the code
select.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e)
{
String skinname = "";
skinname = list.getSelectedValue().toString() ;
}
}
); // end of addActionListener.
system.out.println(skinname) //I want to print skinname here
It will not print because skinname variable define locally. So, can
anypleaes tell me what else I can try so I can print skinname
variable. I tried set and get methods as well but did not work.
If I define skinname outside the ActionListener() then its give me
error says "local variable skinname is accesed from within inner
class; needs to be declared final"
I really appriciated your help.