-
Bug
-
Resolution: Duplicate
-
P1
-
None
-
1.1.3
-
x86
-
windows_nt
Method getSelectedText() does not work near the end of a text located in TextArea on Windows NT, but works o'k on Sparc.
It does not depend on what compiler was used (Sparc or WindowsNT).
Files in attachments:
ta.java - java source
ta.class - compiled ta.java
log.txt - log files (Windows NT and Sparc)
On Windows NT:
[N:/JAVA/BUGS/1997080601] n:/jdk1.1.3/bin/java.exe ta
last_pos = 80
cur_pos = 0
cur_pos = 5
cur_pos = 10
...
cur_pos = 60
cur_pos = 65
java.lang.StringIndexOutOfBoundException: String index out of range: 82
at java.lang.String.substring(String.java:1046)
at java.awt.TextComponent.getSelectedText(TextComponent.java:122)
at ta.<init>(ta.java:31)
at ta.main(ta.java:38)
On Solaris (Sparc):
volga% pwd
/home/nikm/JAVA/BUGS/1997080601
volga% /opt/home/jdk1.1.2/bin/java ta
last_pos = 80
cur_pos = 0
cur_pos = 5
cur_pos = 10
...
cur_pos = 60
cur_pos = 65
cur_pos = 70
cur_pos = 75
^Cvolga%
nikolay.molchanov@Eng 1997-08-07
It does not depend on what compiler was used (Sparc or WindowsNT).
Files in attachments:
ta.java - java source
ta.class - compiled ta.java
log.txt - log files (Windows NT and Sparc)
On Windows NT:
[N:/JAVA/BUGS/1997080601] n:/jdk1.1.3/bin/java.exe ta
last_pos = 80
cur_pos = 0
cur_pos = 5
cur_pos = 10
...
cur_pos = 60
cur_pos = 65
java.lang.StringIndexOutOfBoundException: String index out of range: 82
at java.lang.String.substring(String.java:1046)
at java.awt.TextComponent.getSelectedText(TextComponent.java:122)
at ta.<init>(ta.java:31)
at ta.main(ta.java:38)
On Solaris (Sparc):
volga% pwd
/home/nikm/JAVA/BUGS/1997080601
volga% /opt/home/jdk1.1.2/bin/java ta
last_pos = 80
cur_pos = 0
cur_pos = 5
cur_pos = 10
...
cur_pos = 60
cur_pos = 65
cur_pos = 70
cur_pos = 75
^Cvolga%
nikolay.molchanov@Eng 1997-08-07
- duplicates
-
JDK-4072264 getSelectedText, getSelectedStart/End in TextArea class returns wrong
- Closed