开发者

Java - GetSelectedIndexes problem

开发者 https://www.devze.com 2023-02-18 18:44 出处:网络
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, t

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

精彩评论

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

关注公众号