1. Java Null Pointer Exception on JLIST stackoverflow.comOK so I'm trying to output the current string from an array that was put into a list... However when I click on the list I get a NullPointerException... :\ Help? :)
|
2. JList - Null Pointer Exception coderanch.comIf the line number that "String selectedAccount = accountJList.getSelectedValue().toString();" is on is the one that is reporting a null pointer exception, there are only two things that are causing it: either "accountJList" is null, or "getSelectedValue()" is returning null. You should try and test for both of these problems, but I'm guessing that it's the second. In fact, in the API ... |