如何在JavaFX 9的TableView中获取可见行的索引?在JavaFX 8中,我可以执行以下操作:
// --- The offending imports in Java 9
// import com.sun.javafx.scene.control.skin.TableViewSkin;
// import com.sun.javafx.scene.control.skin.VirtualFlow;
/**
* This is a total hack. We need it as scrollTo jumps the selected
* row to the top of the table. Jarring if the row is already
* visible. As a workaround, we only scroll if the row isn't already
* visible
*
* @return A 2 element ray with the start and end index of visible rows
*/
public int[] …Run Code Online (Sandbox Code Playgroud)