displaying element but erasing everything on location/size change

This commit is contained in:
Macocian Radu
2019-12-17 02:23:51 +02:00
parent 97d8a9f684
commit 2e35474578
5 changed files with 130 additions and 79 deletions

View File

@@ -16,5 +16,23 @@ public class Main {
Button button = new Button();
win.addVisual(button);
int x = 20;
int y = 20;
while(true){
if(x > win.getWidth()){
x = 0;
y+=20;
}
if(y > win.getHeight()){
y = 0;
}
button.setLocation(x, y);
x+=10;
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}