I'm trying to make a thread run my GUI class but every time it runs the run method it completely ignores the while(true) loop i have going and ends up executing nothing, whats strange is that if I add something else to the method such as System.out.println the thread will run.
//GUI is a class I made which implements Runnable
GUI gui = new GUI();
Thread thread = new Thread(gui);
thread.start();
//Doesn't work, will just ignore the while loop
@Override
public void run() {
while(true){
//Launches JavaFx application
launch();
}
}
//If I change it to this or run the program in a debugger it does work
@Override
public void run() {
while(running){
System.out.println("Blah blah blah");
launch();
}
}