Yes, JTable
understands several named scrolling actions, listed below. They are normally used in key bindings, but you can evoke them yourself, as shown in this related example that commandeers the actions defined for a scroll pane.
Addendum: In outline, get the named action from the component's action map:
Action action = table.getActionMap().get(name);
Evoke the action by name when needed:
action.actionPerformed(new ActionEvent(table, 0, name));
Scrolling related action names for JTable
:
scrollDownChangeSelection
scrollDownExtendSelection
scrollLeftChangeSelection
scrollLeftExtendSelection
scrollRightChangeSelection
scrollRightExtendSelection
scrollUpChangeSelection
scrollUpExtendSelection
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…