Swing JTable: Event when row is visible, or when scrolled to the bottom?
问题 I'm looking for a way to be informed when a JTable has scrolled such that a particular row becomes visible, or failing that, when the bottom of the table has scrolled into view. Ideally this should be done without polling, but through some event firing. any ideas? 回答1: Add a ChangeListener to the viewport of the scrollpane. viewport = scrollpane.getViewport(); viewport.addChangeListener(this); then this checks the visible rows (can easily be extended to columns as well) public void