Hi there,
Any long running task
you should farm off to a worker thread. If you do a search for SwingWorkerThread on Google you'll find some good information on the whole concept.
But in this particular case, you will need a seperate thread as it sounds suspiciously like you're doing the long task in the button pressed event, which is executing in the swing ui thread. So, as your task runs (in the swing ui thread) the form cannot react to any other events because you've essentially hijacked the thread that processes the messages of the event queue.
So, in the button handler method, do whatever you need to do to spawn some worker thread and call start() on it. This method will return immediately and the button handler will complete and the button will look normal again.
Bewarey of what you do in the other worker thread. It should not try and update controls directly from that thread, you'll need to marshal the calls across and, make sure you design your programs well because of concurrency issues between the threads (such as being able to press the button again and spawning another thread that starts doing the same work that has already been spawned in the previous button press.
You will need to have a play around with threads to get a better understanding of them.