Axel Richter: Position einer Tabelle ermitteln

Beitrag lesen

Hallo,

wie kann ich die Position top und left einer Tabelle ermitteln?

Mit Java? Ja, ganz einfach.
Die javax.swing.JTable http://java.sun.com/j2se/1.3/docs/api/javax/swing/JTable.html erbt von javax.swing.JComponent http://java.sun.com/j2se/1.3/docs/api/javax/swing/JComponent.html die Methode

getLocation
public Point getLocation(Point rv)
Stores the x,y origin of this component into "return value" rv and returns rv. If rv is null a new Point is allocated. This version of getLocation() is useful if the caller wants to avoid allocating a new Point object on the heap.
Overrides:
getLocation in class Component
Parameters:
rv - the return value, modified to the component's location
Returns:
rv

viele Grüße

Axel