-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0
-
1.2.2
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2024340 | 1.2.0 | Peter Korn | P4 | Resolved | Fixed | swing1.2 |
Name: krT82822 Date: 12/19/98
Original customer synopsis: "Swing text unusable."
The bug occurs in "MultiTextUI.java" in the javax.swing.plaf.multi package. If one uses multiplexing UI's with text, then text is rendered useless.
For example, the cursor is not displayed, and attempts to move about the document using the arrow keys results in the cursor always being moved
to the beginning of the document.
The following exception is associated with the bug (one of these appears for each cursor "blink"):
Exception occurred during event dispatching:
java.lang.NullPointerException
at javax.swing.text.DefaultCaret.paint(Compiled Code)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(Compiled Code)
at javax.swing.plaf.basic.BasicTextUI$SafePainter.run(Compiled Code)
at javax.swing.text.AbstractDocument.render(Compiled Code)
at javax.swing.plaf.basic.BasicTextUI.paint(Compiled Code)
at javax.swing.plaf.ComponentUI.update(Compiled Code)
at javax.swing.plaf.multi.MultiTextUI.update(Compiled Code)
at javax.swing.JComponent.paintComponent(Compiled Code)
at javax.swing.JComponent.paint(Compiled Code)
at javax.swing.JComponent.paintChildren(Compiled Code)
at javax.swing.JComponent.paint(Compiled Code)
at javax.swing.JViewport.paint(JViewport.java:324)
at javax.swing.JComponent.paintWithBuffer(Compiled Code)
at javax.swing.JComponent._paintImmediately(Compiled Code)
at javax.swing.JComponent.paintImmediately(Compiled Code)
at javax.swing.RepaintManager.paintDirtyRegions(Compiled Code)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Compiled Code)
at javax.swing.SystemEventQueueUtilities.processRunnableEvent(Compiled Code)
at javax.swing.SystemEventQueueUtilities$RunnableTarget.processEvent(Compiled Code)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
The problem is that the "bias" version of the MultiTextUI methods modelToView(), viewToModel(), getNextVisualPositionFrom(),
and damageRange() have not been implemented at all. There is a comment in the code to the effect "Add real implementation" in these
methods. Their signatures follow:
o public Rectangle modelToView(JTextComponent t, int pos, Position.Bias bias)
throws BadLocationException
o public int viewToModel(JTextComponent t, Point pt,
Position.Bias[] biasReturn)
o public int getNextVisualPositionFrom(JTextComponent t, int pos,
Position.Bias b, int direction,
Position.Bias[] biasRet)
throws BadLocationException
o public void damageRange(JTextComponent t, int p0, int p1,
Position.Bias firstBias,
Position.Bias secondBias)
We first reported this bug against swing-1.1beta2 around Sep 28/98. We are concerned that the bug has not been fixed in JDK1.2 Release
Candidate 2. We have not got a complete fix, but with a few lines of code, MultiTextUI can be made at least usable. We figure "usable" is better
than "completely broken", especially when the effort is small. Find attached in part 6 or your bug report form a version of "MultiTextUI.java" that
incorporates our fixes -- the proposed changes have been tested here and they work.
Thank you for your consideration, and hopefully this helps.
(Review ID: 48472)
======================================================================
- backported by
-
JDK-2024340 MultiTextUI not fully implemented yet? (modelToView/viewToModel, etc.)
-
- Resolved
-