I have 2 methods, the first one where i display selected value, index from my JList(list). What i want to do is to send selectedValue - s - to CreateMap method. I tried this cod
I assume you have 2 String variables called s, one global and one local in actionPerformed.
s
actionPerformed
Change the line
String s = (String) list.getSelectedValue();
to
this.s = (String) list.getSelectedValue();
And it should work. Be sure you have a global variable called String s.
String s