Java - GetSelectedIndexes problem
My problem is my compiler isnt recognising getSelectedIndexes. I've got all the awt and swing libraries imported and PartyList is a Jlist thats been set up and works, can anyone give me any advice, thanks
else if(e.getSource() == jButton9) // if play button is开发者_StackOverflow pressed {
int []selectedIndexes = PartyList.getSelectedIndexes();
drawApp(4);
}
You probably need PartyList partyList = new PartyList();
getSelectedIndexes is a instance level method. You can't call it without instantiating the class...
You want JList's getSelectedIndices, not getSelectedIndexes.
精彩评论