Example usage for java.awt Rectangle setLocation

List of usage examples for java.awt Rectangle setLocation

Introduction

In this page you can find the example usage for java.awt Rectangle setLocation.

Prototype

public void setLocation(int x, int y) 

Source Link

Document

Moves this Rectangle to the specified location.

Usage

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);
}