-3

I used the following code to make a circle. I need to make a button to save the coordinates of the circle. How do I extract these coordinates?

GraphicsContext gc = canvas.getGraphicsContext2D();
gc.setStroke(Color.BLUE);
Random rnd = new Random();
int x = rnd.nextInt((int) canvas.getWidth());
int y = rnd.nextInt((int) canvas.getHeight());
gc.strokeRect(x, y, 100, 100);
Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373

1 Answers1

0

Put the coordinates and any other pertinent data into into an ArrayList of custom object or other collection, and then when needed, save the collection however you plan to save your data, be it database, xml, serialization,...

Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
  • Note that your question is quite broad, and this is resulting in my posting a very broad (and community wiki) answer. If you need more specific help, then please increase the specificity of your question as well as including what you're currently trying. – Hovercraft Full Of Eels Jul 23 '16 at 02:11