How to move items between two ListViews with change listener JavaFX
问题 I have two ListView s, allStudentsList has items already populated within it, currentStudentList has none. My aim for when the user selects an item in allStudentList is for that item be moved into currentStudentList . I have done this by placing a listener on the selection model of the allStudentList . I get an IndexOutOfBoundsException and I am not sure why this is occurring. From testing, it seems that this problem is isolated to the last 4 lines of this method yet I am not sure why.