JDK-7124528 : [macosx] Selection is not cleared properly in text component.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: generic,x86
  • Submitted: 2011-12-23
  • Updated: 2012-03-22
  • Resolved: 2012-03-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7u4 b13Fixed 8Fixed
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.

SUGGESTED FIX http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/7816a64158c4

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.