Ok, so my problem is this: I did a little java program to take the number of seconds from a text box and sleep a thread for that amount of seconds. Just to make it clear, here is the piece of code I used:
jTestare.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
try {
Thread.sleep((Integer.parseInt(getStringInterval())));
} catch (InterruptedException ex) {
ex.printStackTrace();
}
getLblReprGrafica().setOpaque(true);
getLblReprGrafica().setBackground(Color.RED);
getLblProcent().setText("100%");
}
});
Now my problem is how can I make this piece of code shared by a bunch of buttons (without them interfering with one another, like in starting one thread, moving two text boxes to the right, inputing a value then hitting Run on the respective button, and so on). I don't know if this can be done, but it was given to me as an assignment a couple of years ago and I only did it with one thread.