Nov 5, 2015 06:02 PM
(This post was last modified: Nov 5, 2015 06:15 PM by Barinade.)
I've tried this
In main method
field - static InitThread init = new InitThread();
InitThread
But it writes "fin" before "x"
There's a button on the LoginForm that calls notify() on InitThread too
Edit: removed InitThread from the constructor of LoginForm since it's static and I can just access it from main class
Edit2: Forget this, just gonna make it run the code I want it to wait for inside the interface :/
In main method
field - static InitThread init = new InitThread();
Code
init.start();
synchronized (init) {
init.wait();
System.out.println("fin");
}InitThread
Code
public class InitThread extends Thread {
@Override
public void run() {
synchronized (this) {
if (settings.get("user_info", "username", String.class) == null || settings.get("user_info", "password", String.class).equals("")) {
new LoginForm(this);
} else {
System.out.println("x");
notify();
}
}
}
}But it writes "fin" before "x"
There's a button on the LoginForm that calls notify() on InitThread too
Edit: removed InitThread from the constructor of LoginForm since it's static and I can just access it from main class
Edit2: Forget this, just gonna make it run the code I want it to wait for inside the interface :/
![[Image: apgoRtH.png]](https://i.imgur.com/apgoRtH.png)

