Thanks Thomas for the tip. I think I have made an appropriate correction.

I was calling invokeLater on a method that adds a character to the output
for anything that wasn't a newline. For newlines I would call invokeAndWait
when I was displaying the output in the window. It seems that using
different calls was producing the wobble; an effect that wasn't evident
when I was running my program over a slower machine.

So, I call invokeAnWait for both cases, and although the mechanism works
slower by a factor of about 100 (cf. the attached - ~4ms versus ~40ns), the
wobble appears to have gone.

On Fri, 8 Mar 2024 at 00:36, Thomas Wolf <tjw...@gmail.com> wrote:

> You’re making all the Swing calls in the EDT (vs directly in the threads
> you mentioned), right?
>
> Tom
>
> On Mar 7, 2024, at 6:40 AM, Owen Thomas <owen.paul.tho...@gmail.com>
> wrote:
>
> 
> The numbers running down the left are milliseconds, all others are nanos.
> As you can see, all this happens within the same millisecond, and perhaps
> I'm thinking that Swing wasn't built with rendering output at this rate in
> mind.
>
> Anyway, I'd love to know what people have to say. :)
>
> On Thu, 7 Mar 2024 at 22:04, Owen Thomas <owen.paul.tho...@gmail.com>
> wrote:
>
>> Hello Netbeans people. This is not a question for Netbeans itself, but I
>> know there are a lot of clever people here who may be able to give me a
>> pointer or two, so please look away if this question might offend. I hope
>> it doesn't. :)
>>
>> My program uses Swing. It outputs text to a window. The output is
>> attached. At a particular point (the line is highlighted in the attached
>> screenshot) the output begins to wobble; that is, the line spacing becomes
>> uneven and (perhaps) even characters appear to be squashed.
>>
>> Now, I thought this might be something to do with how quickly the output
>> is produced (it is produced very quickly - those numbers are time
>> measurements in nanoseconds) and how competing threads might cause the
>> Swing GUI innards to lose their grip somehow, but when I tried wrapping
>> some of my code within synchronised blocks, I didn't see any improvement.
>>
>> Surely I think to myself things like this have been done before. Does
>> anyone know how I might be able to stop this wobbling?
>>
>> Thanks,
>>
>>   Owen.
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to