V
Vojta
Hello!
I have a thread that goes through directories and stores filenames found
into a file. I also have a frame (JFrame) with text field (JTextField). When
the thread is running the text field shows which directory is currently
beeing processed. It works great until I try to make a selection with mouse
inside the text field. Application freezes immediatelly. Please, what have I
done wrong?
Thank you! Vojta
The frame implements my ThreadListemer interface...
public interface ThreadListener {
void ThreadStarting(Thread t);
void ThreadEnding(Thread t);
void ThreadProgressChanging(Thread t);
}
.... and defines it's abstract methods. I was experimenting with method
ThreadProgressChanging which is responsible for updating text field but the
problem still persists.
public void ThreadProgressChanging(Thread t) {
synchronized(jTextField1 ) {
jTextField1.setText(((FileScannerThread)t).currentPath);
}
}
I have a thread that goes through directories and stores filenames found
into a file. I also have a frame (JFrame) with text field (JTextField). When
the thread is running the text field shows which directory is currently
beeing processed. It works great until I try to make a selection with mouse
inside the text field. Application freezes immediatelly. Please, what have I
done wrong?
Thank you! Vojta
The frame implements my ThreadListemer interface...
public interface ThreadListener {
void ThreadStarting(Thread t);
void ThreadEnding(Thread t);
void ThreadProgressChanging(Thread t);
}
.... and defines it's abstract methods. I was experimenting with method
ThreadProgressChanging which is responsible for updating text field but the
problem still persists.
public void ThreadProgressChanging(Thread t) {
synchronized(jTextField1 ) {
jTextField1.setText(((FileScannerThread)t).currentPath);
}
}