hoomanv
asked on
Implement Blinking Caret
I'm implementing an editor component from scratch (for J2ME environment)
Now I'm totally confused on how to make the caret blink efficiently
A separate thread is used to change the caret's blink-state at regular intervals
But how should I deal with drawing it ?
Should the thread, signal the component (extended from Canvas) to repaint (redrawing everything) ? that would be inefficient in my opinion
It neither can draw directly into the component's Graphics object, only the paint method is responsible for that
Could someone please help me ?
Now I'm totally confused on how to make the caret blink efficiently
A separate thread is used to change the caret's blink-state at regular intervals
But how should I deal with drawing it ?
Should the thread, signal the component (extended from Canvas) to repaint (redrawing everything) ? that would be inefficient in my opinion
It neither can draw directly into the component's Graphics object, only the paint method is responsible for that
Could someone please help me ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BTW all UI modifications should be done from the EDT so try not to implement another thread to do it/ repaint.