开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜