#2 JDK1.4 Cursor not displayed

closed-fixed
nobody
None
5
2002-08-06
2001-11-15
Anonymous
No

In jdk1.4 (beta3) the cursor is not displayed on an empty line. After
searching the problem was in this routine in TextAreaPainter in
painCaret.

new code:
[code]
protected void
paintCaret(Graphics gfx, int line, int y) {
if(textArea.isCaretVisible()) { int offset =
textArea.getCaretPosition()-
textArea.getLineStartOffset(line); int caretX =
textArea.offsetToX(line,offset); int caretWidth =
((blockCaret || textArea.isOverwriteEnabled()) ?
fm.charWidth('w') : 1); y += fm.getLeading() +
fm.getMaxDescent(); int height = fm.getHeight();
gfx.setColor(caretColor);
if(textArea.isOverwriteEnabled()) { int caretY =
y+height-1;
gfx.drawLine(caretX,caretY,caretX+caretWidth,caretY);
} else gfx.drawLine(caretX,y,caretX,y+height-1);
} }
[/code]
this draws the cursor correct.

Related

Code: code

Discussion

  • Oliver Henning

    Oliver Henning - 2002-08-06
    • status: open --> closed-fixed
     
  • Oliver Henning

    Oliver Henning - 2002-08-06

    Logged In: YES
    user_id=587183

    Fixed in 2.2.2 RC 1

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks