There's no need to use those indexes with Lists. You're probably getting errors (though I don't see you updating 'count') because you're using indexes on data structures which may be initially empty...
Type: Posts; User: Sean4u
There's no need to use those indexes with Lists. You're probably getting errors (though I don't see you updating 'count') because you're using indexes on data structures which may be initially empty...
OK, I see the last version of FileSearch you have put the search parameters as arguments to the run method. Did you read the API documentation for Thread.run(). Can you see what is happening now when...
Yeah, that will work - but it's a bit nasty! Thread has a run() method. What happens when you instantiate a new Thread is ... nothing. It's not until you invoke the Thread's start() method that an...
No, I didn't compile your original code. There is currently a fairly major problem in your run() method which probably worked (badly) before but now will not. Your FileSearch object is now a Thread....
No, you already have two threads. One thread is the AWT event thread which is what invokes your actionPerformed method and is also responsible for updating any GUI fields you update (so the...
Have another look at the API docs for java.lang.Thread. Your constructor should just be used to pass in the resources the thread will use *while it is searching*. The actual searching itself should...
Done. I occasionally employ that in trial code when I'm pushed for time, it works - but the error exit code from the JVM is a fatal side-effect.
Just in case it helps, here's a little program that demonstrates the idea:
public class SimpleNotify
{
private boolean keepRunning = true;
/* Class static code runs before any method is...
You always create a new FileSearch object every time you search, so one way you could do this would be to make FileSearch into a Thread (by extending Thread, for example - see the Thread API docs for...
It's the AWT event thread that is executing the code in your actionPerformed so it won't be able to also repaint the Text until your actionPerformed method finishes (I think). Could you Thread your...