I checked for that.  That's not it.  Thanks though.

Brian

On Mon, Mar 3, 2008 at 4:43 PM, Jeff Emanuel <jemanuel@frii.com> wrote:
It is likely your method addLine is being called
on the event dispatch thread.

Brian O'Neill wrote:
> I fear this might be more of a Swing issue than a Jython issue, but I hope
> that someone with experience with both might be able to help me with this
> problem.  I am using EventQueue.invokeLater to handle changes to a JTable
> and also to handle repainting the table.  Unfortunately, many of the calls
> get held off until the rest of the program has executed, so that the display
> of the JTable doesn't update mid-execution, but only at the end.  This
> occurs even when I put yield() and sleep() calls at the end of the method in
> the hope of giving the Event Dispatch thread time to execute.  I've attached
> the method in question, and also in-lined it below.
>
> So, in short, my question is: What do I need to do to get the JTable to be
> updated and repainted mid-execution?
>
> Any help appreciated!
>
> Thanks,
> Brian O'Neill
> boneill@cc.gatech.edu
>
> ##############################################################
>
>     def addLine(self, line_no, instr, values):
>     #Internal Class for firing table changes in Event Dispatch Thread
>     class runner(Runnable):
>         ROWDELETE = 0
>         ROWUPDATE = 1
>         ROWINSERT = 2
>         ROWHIGHLIGHT = 3
>
>         def __init__(self, model, fireMode, first, last=None):
>         #Add things you need
>         self.model = model
>         self.fireMode = fireMode
>         self.first = first
>         self.last = last
>
>         def run(self):
>         #Fire table change
>         if(self.fireMode == runner.ROWDELETE):
>             self.model.fireTableRowsDeleted(self.first, self.last)
>         elif(self.fireMode == runner.ROWUPDATE):
>             self.model.fireTableRowsUpdated(self.first, self.last)
>         elif(self.fireMode == runner.ROWINSERT):
>             self.model.fireTableRowsInserted(self.first, self.last)
>         elif(self.fireMode == runner.ROWHIGHLIGHT):
>
> self.model.debugger.interpreter.program.gui.editor.document.highlightLine(
> self.first)
>     #End internal class
>     ###############################
>     #Internal class for repainting the table in Event Dispatch Thread
>     class repainter(Runnable):
>         def __init__(self, table):
>         self.table = table
>
>         def run(self):
>         manager = swing.RepaintManager.currentManager(self.table)
>         rect = manager.getDirtyRegion(self.table)
>         self.table.paintImmediately(rect)
>         #self.table.revalidate()
>         #self.table.repaint()
>         #manager.paintDirtyRegions()
>     #End internal class
>     ###############################
>         fire = 0
>     if self.nextLine:
>             #calculate whether to fire or not
>             import random
>             real_speed = (float(self.debugger.speed) /
> self.debugger.speed_factor)
>             if self.debugger.speed == 0:
>                 fire = 1
>             else:
>                 inter_rate = self.rate_at_running_mode / real_speed
>         #print "inter_rate", inter_rate
>                 fire = (self.max_refresh_rate / real_speed > 1) or (
> random.uniform(0, 1) < inter_rate)
>         #fire = 0
>
>             if len(self.lines) > MAX_LINES:
>                 if self.lines[0][1] == CROPPED_MESSAGE:
>                     self.lines.remove(self.lines[1])
>             #if fire: self.fireTableRowsDeleted(1, 1)
>             if fire: EventQueue.invokeLater(runner(self, runner.ROWDELETE,
> 1, 1))
>                 else:
>                     line = ['-', CROPPED_MESSAGE]
>                     self.lines[0] = line
>             #if fire: self.fireTableRowsUpdated(0, 0)
>             if fire: EventQueue.invokeLater(runner(self, runner.ROWUPDATE,
> 0, 0))
>             self.nextLine.extend(values)
>             self.lines.append(self.nextLine)
>         #if fire: self.fireTableRowsInserted(len(self.lines)-1, len(
> self.lines)-1)
>         if fire: EventQueue.invokeLater(runner(self, runner.ROWINSERT, len(
> self.lines)-1, len(self.lines)-1))
>             # also update the editor currentline highlight
>         if fire:
>
> #self.debugger.interpreter.program.gui.editor.document.highlightLine(
> self.nextLine[1])
>         EventQueue.invokeLater(runner(self, runner.ROWHIGHLIGHT,
> self.nextLine[1]))
>         self.nextLine = []
>
>         if len(self.lines) > 0:
>             self.nextLine.append(self.lines[len(self.lines)-1][0]+1)
>         else:
>             self.nextLine.append(1)
>     self.nextLine.append(line_no)
>         self.nextLine.append(instr)
>     EventQueue.invokeLater(repainter(self.panel.table))
>     Thread.yield()
>     Thread.currentThread().sleep(500)
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Jython-users mailing list
> Jython-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users