How can you make sure that the object still exists? How to make the object exist at a certain point? There is such code:
public void onMouseDown(MouseDownEvent event) { final MouseDownEvent e = event; timer = new Timer() { @Override public void run() { int x = e.getX(); int y = e.getY(); } }; timer.schedule(timeDelay); }
As a result, on the call int x = e.getX();
falls with an error.
(TypeError): Cannot read property 'clientX' of null arguments: clientX, type: non_object_property_load
How to make it so that after the timer is triggered to get access to all the fields of the MouseDownEvent
object?
Is it possible to copy an object ( clone
similarity)?
Tried to make a subclass and override some fields, did not help. Apparently, it is necessary, either to override everything, or to look for another way.