United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7124528 [macosx] Selection is not cleared properly in text component.
JDK-7124528 : [macosx] Selection is not cleared properly in text component.

Details
Type:
Bug
Submit Date:
2011-12-23
Status:
Closed
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2012-03-05
Component:
client-libs
OS:
os_x
Sub-Component:
java.awt
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7u4 (b13)

Related Reports
Backport:

Sub Tasks

Description
http://java.net/jira/browse/MACOSX_PORT-616 submitted 2011/10/31 by Yuri Nesterenko
Run the attached example with two TextField components and a button.
Select whole of the first text field.
After that, select the content of the second text field.
Press button to see a result of t1.getSelectedText() :
it should be empty but it is whatever used to be selected in the first text field.

                                    

Comments
EVALUATION

Author: Yuri Nesterenko Date: 31/Oct/11 09:53 AM
Build: b214
closed/java/awt/TextComponent/DeselectionDuringDoSelectionNonVisibleTest/DeselectionDuringDoSelectionNonVisibleTest
 
Author: Sergey Bylokhov Date: 08/Nov/11 02:44 PM
Looks like on windows it works in the same way?
 
Author: Yuri Nesterenko Date: 09/Nov/11 06:19 AM
Well, but not in the Apple Java 6 nor in Linux. And perhaps that is a bug in Windows implementation since when you return focus to t1, you have correct (empty) selection. So selection is cleared visually and after refocusing back but not immediately after another field selection.
                                     
2011-12-23
SUGGESTED FIX

http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/7816a64158c4
                                     
2012-02-13



Hardware and Software, Engineered to Work Together