List of usage examples for java.awt Rectangle setLocation
public void setLocation(int x, int y)
From source file:xtrememp.PlaylistManager.java
public void makeRowVisible(int rowIndex) { if (!(playlistTable.getParent() instanceof JViewport)) { return;//w w w . j a v a 2 s . c o m } JViewport viewport = (JViewport) playlistTable.getParent(); Rectangle contentRect = (Rectangle) playlistTable .getCellRect(rowIndex, playlistTable.getSelectedColumn(), true).clone(); Point pt = viewport.getViewPosition(); contentRect.setLocation(contentRect.x - pt.x, contentRect.y - pt.y); viewport.scrollRectToVisible(contentRect); }