Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating objects and removing them on mouse click

2647471Apr 3 2014 — edited Apr 8 2014

I am stuck with the problem of removing objects from the scene. Here's my problem :

On mouse click, I create a circle and apply translation.

and on the second mouse click I want to clear it off.

So, to clear the scene, I tried,

MouseEvent {

root.getChildren.removeAll()

create circle

}

doesn't seem to work.Any ideas. I came across canvas, but I am not sure if I need it, because animating a circle works great, but not clearing it..

This post has been answered by shakir.gusaroff on Apr 4 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2014
Added on Apr 3 2014
14 comments
6,103 views