try{
f = new ProjectFile();
numProject = f.getOutput();
String[] projectData = new String[numProject.length];
//retrieving data from another file and store the title to projectData
for (int i = 0; i < projectData.length; i++) {
projectData[i] = numProject[i].getProjectTitle();
}
listProject.setListData(projectData);
System.out.println(listProject.getSelectedIndex());
}catch(Exception e){
}
use getSelectedIndices()
method
public int[] getSelectedIndices()
Returns an array of all of the selected indices, in increasing order.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.