JDK-6431072 : Painting problems in the bottom of xawt TextArea when autoscrolling on append
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86
  • Submitted: 2006-05-26
  • Updated: 2021-07-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
When xawt TextArea is autoscrolling on appending a newline, ugly flicker happens in the bottom of textarea, and sometimes the bottom part just does not get repainted correctly at all. This is obvious with remote X access, maybe it's less visible with local desktop.

This is reproducible since double-buffering was enabled on used swing components (6352604). Before that, there were multiple flicker problems, but there were no painting erorrs in the bottom of the component.

Comments
- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

EVALUATION Using invokeLater() leads to reversed order of lines in TextComponent. InvokeAndWait() looks good and passed regression testing but I'm aware of deadlocks whether in JDK or in user code. I'm about to defer it for now.
16-06-2006

EVALUATION Appending a text supposes an invocation on EDT (this is how it works in Swing). AWT instead perform all text operations on a Main thread. This leads to a thread race between EDT (painting) and Main thread (text modifications). To avoid this situation we may post a text-modification code into EDT. This approach already solved the reported problem. Should also decide about other operations like "replace".
16-06-2006

SUGGESTED FIX *** /tmp/geta977 2006-06-16 15:09:03.000000000 +0400 --- XTextAreaPeer.java 2006-06-16 14:52:44.000000000 +0400 *************** *** 47,53 **** import javax.swing.plaf.BorderUIResource; import java.awt.im.InputMethodRequests; import sun.awt.CausedFocusEvent; ! class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { --- 47,53 ---- import javax.swing.plaf.BorderUIResource; import java.awt.im.InputMethodRequests; import sun.awt.CausedFocusEvent; ! import java.lang.reflect.InvocationTargetException; class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { *************** *** 629,636 **** * DEPRECATED * @see java.awt.peer.TextAreaPeer */ ! public void insertText(String txt, int pos) { ! insert(txt, pos); } /** --- 629,650 ---- * DEPRECATED * @see java.awt.peer.TextAreaPeer */ ! public void insertText(final String txt, final int pos) { ! if ( EventQueue.isDispatchThread()){ ! insert(txt, pos); ! } else { ! try { ! EventQueue.invokeAndWait(new Runnable() { ! public void run() { ! insert(txt, pos); ! } ! }); ! } catch (InterruptedException e){ ! //log error ! } catch (InvocationTargetException e){ ! //log error ! } ! } } /** }
16-06-2006

EVALUATION Adding an element into TextArea supposes two types of actions: 1. scroll the area down 2. text repainting Seem its a thread race between scrolling and painting because I see that the last line (strangely that I've never seen painting artefacts on other lines) paints incorrectly including bottom inner border of TA.
06-06-2006