JDK-4244100 : JTextArea loses selection on popup or other menu click
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.0,1.2.1,1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,windows_95,windows_nt
  • CPU: generic,x86
  • Submitted: 1999-06-04
  • Updated: 2000-12-18
  • Resolved: 2000-12-18
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description

Name: skT88420			Date: 06/04/99


Similar to or same as Bug 4096971. This was fixed in Swing 1.1,
but is broken again in Swing 1.1.1 Beta 2 (and maybe Beta 1). 
Please do not close this bug as a duplicate of the fixed bug. It
is broken again, and the current behavior is totally unacceptable
and non-standard. After selecting text in a JTextArea, then
using the right mouse to popup a menu, or the left mouse to
access an application menu, the selection is lost! (At least
visually.) Generally a user makes a selection in order to do
something with the selected text, but now that selection goes
away! This makes us, the developers who support Sun and Java,
look bad when our apps don't work as expected. Our users don't
really want to hear "it's the language's fault!" Please fix this
before 1.1.1 Final is released!
(Review ID: 83916) 
======================================================================

Name: skT88420			Date: 06/09/99


If I have 2 jInternalFrames each with a jTextArea.  When I call select the data is highlighted like I expect.  If I call select on the other jTextArea, the data is highlighted but the previous highlight disappears.  I have tried to capture the paint method and re"select" the text but I get into an infinite paint loop.
(Review ID: 84163)
======================================================================

Comments
EVALUATION The selection isn't lost, but rather is no longer displayed when focus is lost on the text component. This is the correct behavior for when focus changes frames, but under windows the selection remains displayed while menu items are selected. The mechanism under AWT is to mark focus lost events as "temporary" when a menu grabs the focus (with the idea that focus will be returned when the menu item is done with it). The menu item should grab temporary focus (which it currently doesn't have a way to do) and return it to the text component when done. DefaultCaret should not hide the selection if the focus loss is temporary and has been fixed. timothy.prinzing@eng 1999-08-19 The new AWT focus architecture proposal for merlin will have support for generating "temporary" focus change events. This will allow swing's menu implementation to temporarily grab the focus, which will allow the text component to properly determine whether the selection should remain visible or not. Once we have the new AWT api implementation, we can fix this for merlin. amy.fowler@Eng 2000-02-17 JMenu will now request temporary focus changes via the new focus architecture, and is being addressed via 4371580, which I am closin this as a duplicate of.
17-02-2000