posted 11 years ago
> When i try to print it in option pane it is saying index -1 means no item selected right
more likely it means you have a fully initialised class field
JList countriesList = new JList();
then, in the constuctor, again a fully initialised *local* variable
JList countriesList = new JList();
where the local variable is the one on the screen, the class field (no elements)
is the one accessed from the button's listener
could even be the models, as above.
check your constructor, if you find something like the above, change
//JList countriesList = new JList();
to
countriesList = new JList();
> '[I@30186b31'
is generally a memory address