开发者

"Build Automatically" function with Swing

开发者 https://www.devze.com 2023-03-14 19:14 出处:网络
How should I implement a function like th开发者_开发百科at on my Swing editor? I was thinking of a thread started on a releaseKey event. This thread should have a timer of a second. Every time I have

How should I implement a function like th开发者_开发百科at on my Swing editor? I was thinking of a thread started on a releaseKey event. This thread should have a timer of a second. Every time I have the releaseKey I either start the thread or just reset the timer if it is already running. I'm not convinced though. It seems like too heavy on the UI. How should I do it?


A Timer starting/stopping every second is not a big weight on the UI at all. The "building" is what is going to possibly take some time. I think looking for a pause in keystokes is a fine solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号