United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4785160 : It's possible to make cursor invisible when typing in JTextArea with JScrollBar

Details
Type:
Bug
Submit Date:
2002-11-26
Status:
Open
Updated Date:
2006-05-23
Project Name:
JDK
Resolved Date:
Component:
client-libs
OS:
generic,windows_xp
Sub-Component:
javax.swing
CPU:
x86,generic
Priority:
P4
Resolution:
Unresolved
Affected Versions:
1.4.1,5.0
Targeted Versions:

Related Reports

Sub Tasks

Description

Name: jk109818			Date: 11/26/2002


FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

FULL OPERATING SYSTEM VERSION :

Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
There is a JTextArea inside JScrollPane. If you are typing
into JTextArea then cursor becomes invisible just after
horisontal scrollbar appears. The typed text is visible (it
is shifted to the left) but cursor is not. Definetely it
should. This is reproducible at least under Windows and
Metal LookAndFeels. Under CDE/Motif only a small part of
cursor is visible.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile and launch the attached example.
2. Put focus into text aread and srart typing until
horizontal scrollbar appears.
3. Just after apparing of scroll bar the cursor becomes
invisible.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected: Cursor must be visible all the time you are typing
into text area.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.*;

/**
 * @author Vladimir Kondratyev
 */
public class Test {
  public static void main(String[] args){
    JFrame frame=new JFrame("Example");
    frame.setBounds(100,100,200,200);
    frame.addWindowListener(
      new WindowAdapter(){
        public void windowClosing(WindowEvent e){
          System.exit(0);
        }
      }
    );

    frame.getContentPane().setLayout(new BorderLayout());
    JTextArea textArea=new JTextArea();
    frame.getContentPane().add(new JScrollPane(textArea),BorderLayout.CENTER);

    frame.show();
  }
}

---------- END SOURCE ----------
(Review ID: 166465) 
======================================================================

                                    

Comments
EVALUATION



Name: ik75403			Date: 12/03/2002



This bug will not be fixed in mantis




======================================================================

Name: anR10225			Date: 08/27/2003


    The text area preferred size doesn't take into account
the caret width that's why there is no space for caret at the
end of the longest line.
    We should take into account the caret width (DefaultCaret
extends Rectangle) when calculating text area preferred width.


======================================================================
we had to roll back the fix for this bug.
(see 4950107)
###@###.### 2003-11-11
                                     
2003-11-11
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-09-25



Hardware and Software, Engineered to Work Together