Show splash screen for x amount of seconds
Is there a better way to show a splash screen for x seconds than putting it in a while loop? It just seems so inefficiant and it uses a lot of processing power. This is what I have:long startTime = System.currentTimeMillis();
while(System.getCurrentTimeMillis() <= startTime + 5000){
//wait
}
mainPage.setVisible(true);

