I\'ve been searching around this site and the internet for hours trying to figure out how to fix this problem. I\'m creating a game and it\'s my first time using graphics. I
Don't sleep
or otherwise block on the AWT Event Dispatch Thread (EDT).
Use javax.swing.Timer
instead. Note: not any other class of the same name in a different package.
javax.swing.Timer timer =
new javax.swing.Timer(2500, event -> {
testing.setText("hi");
});
timer.setRepeats(false);
timer.start();