Get these lines of code to loop


Get these lines of code to loop forever?

EventHandler eventHandler = e -> {
xPos1.setValue(xPos1.getValue() + 1 * 10);
if (xPos1.getValue() > xPos2.getValue()) {
xPos2.setValue(xPos2.getValue() + 1 * -10);
}
};

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Get these lines of code to loop
Reference No:- TGS02398290

Now Priced at $10 (50% Discount)

Recommended (98%)

Rated (4.3/5)