Point(2D) in JavaFX | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Point(2D) in JavaFX

Hello. If I want to define a point in Java 2D with Canvas, which class must I use? I tried it with the class Point2D but it didn't worked. Thank you for any help.

23rd Feb 2018, 5:39 PM
nwytg
6 Answers
+ 1
import javafx.geometry.Point2D;
23rd Feb 2018, 5:43 PM
Sad
Sad - avatar
+ 1
@Tom it doesn't works... or I make a mistake.
23rd Feb 2018, 5:45 PM
nwytg
+ 1
I also tried to say Point2D center = new Point2D(100, 100); System.out.println(center.getX(), center.getY()); The output was 0 0
23rd Feb 2018, 5:47 PM
nwytg
+ 1
EDIT: it works now. It only doesn't works in one method. In the other method it works. I don't know why, but it works now.. Thank you for your help.
23rd Feb 2018, 6:09 PM
nwytg
0
Try 100.0 istead of 100
23rd Feb 2018, 5:53 PM
Sad
Sad - avatar
0
Your welcome :p ☺
23rd Feb 2018, 6:26 PM
Sad
Sad - avatar