Hallo!
Ich möchte zwei Integer-Koordinaten in ein Objekt der Klasse Point2D umwandeln.
Ich habe jetzt in der Klasse SwingUtilities folgende Methode gefunden:
Ich weiß leider nicht, was ich als Parameter für Component source und destination angeben muss, und ob das überhaupt die richtige Methode ist.
Vielen Dank für eure Hilfe im voraus!
Ich möchte zwei Integer-Koordinaten in ein Objekt der Klasse Point2D umwandeln.
Ich habe jetzt in der Klasse SwingUtilities folgende Methode gefunden:
Code:
convertPoint
public static Point convertPoint(Component source,
int x,
int y,
Component destination)
Convert the point (x,y) in source coordinate system to destination coordinate system.
If source>is null,(x,y) is assumed to be in destination's root component coordinate system.
If destinationis null, (x,y) will be converted to source's root component coordinate system.
If both source and destination are null, return (x,y) without any conversion.
Ich weiß leider nicht, was ich als Parameter für Component source und destination angeben muss, und ob das überhaupt die richtige Methode ist.
Vielen Dank für eure Hilfe im voraus!