If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Swing & threading: Trying to use invokeLater in a loop and failing

Hi everyone,
First off I'd like to say thank you for providing a community where I can ask questions that I can't find solutions to anywhere else.
I've been working on some code for awhile that takes an image from a file or a camera and processes it, then calls another class to create and mantain the GUI. I'm completely new to the execution of threading, but I understand the concept - I'm just such a neophyte that I can't make the two converge.
Anyway, my processing code works and my GUI sort of does. I've been teaching myself Swing while working on the GUI, so please pardon its messyness.
Problem: GUI fails to repaint when I call a long processing method/methods. I know this can be solved with threads, but I don't know how to impliment them.
Here's what I'd like to do, and here's what I've tried:
Goal: Everything in the GUI works except my jToggleButton. I would like it to execute a method only when it is selected - meaning that I'll have to find a way to break an infinite loop. One problem, though, is that my GUI is not updating so even if I had the code, I couldn't just say "click again to stop." I'd also like my GUI to update a few components (or the whole thing, doesn't matter) after every iteration of the loop.
What I've tried: Just about everything I could find. I TRIED threading but it confused me, I've tried just using for loops to see if invokeLater or invokeAndWait would work, and I've tried putting my update code just about everywhere. I've also used repaint() paintImmediately(), etc. I think the fact that I'm calling from within a loop means that even invokeLater won't execute until the loop is "done" - which it never is, since I can't stop it. It does update after the for loop is complete.

Here's some code from the updateGUI thread - I'd be happy to post more, but I code messily. My two classes are easily 1,000 lines (with comments) together. I've posted the sections that are most directly related to my problems.