Example usage for javax.swing JTable getLocationOnScreen

List of usage examples for javax.swing JTable getLocationOnScreen

Introduction

In this page you can find the example usage for javax.swing JTable getLocationOnScreen.

Prototype

public Point getLocationOnScreen() 

Source Link

Document

Gets the location of this component in the form of a point specifying the component's top-left corner in the screen's coordinate space.

Usage

From source file:MainClass.java

public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row,
        int column) {
    if (value == null) {
        return this;
    }//w w w. j a va2s.  co  m
    if (value instanceof Volume) {
        setValue(((Volume) value).getVolume());
    } else {
        setValue(0);
    }
    table.setRowSelectionInterval(row, row);
    table.setColumnSelectionInterval(column, column);
    originalValue = getValue();
    editing = true;
    Point p = table.getLocationOnScreen();
    Rectangle r = table.getCellRect(row, column, true);
    helper.setLocation(r.x + p.x + getWidth() - 50, r.y + p.y + getHeight());
    helper.setVisible(true);
    return this;
}