This is how the thing goes: I have a JFrame for the main window of a Java application, that contains a panel with multiple JProgressBar. I want to start a Thread for each JProgressBar that will start another Threads on their own. When any of this "secondary" threads finishes, I want to update the JProgressBar in my JFrame. Moreover, before arranging all this, as I don't want the user to be able to click anything on the JFrame, I also want to setEnabled(false) some buttons in the JFrame. Easy?
ActivarBotones abFalse = new ActivarBotones(false);
abFalse.start();
try {
abFalse.join();
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
EstablecerConexiones ec = new EstablecerConexiones();
ec.start();
try {
ec.join();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ActivarBotones abTrue = new ActivarBotones(true);
abTrue.start();
Two problems.
If I run the code from above, nothing got updated. If I only start the ec thread, everything works almost right.
I don't know much about synchronization and don't know what should I do to start concurrently all the "primary" threads.
Any clues?