JDK-4522641 : BasicTextUI.setSize() can restore focus incorrectly
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2001-11-03
  • Updated: 2002-01-08
  • Resolved: 2002-01-08
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The fix to 4465905 changed BasicTextUI to reinstate focus after invoking setSize on the root view. This corrects the problem where HTML form text fields, displayed in a JEditorPane, were losing focus when typing in them. Unfortunately it adds a negative side effect.

The attached test program shows the problem. It is a simple editable JEditorPane with two form text fields. Click on one field to give it focus. Now try to click on some text in the JEditorPane. Notice that focus jumps back to the text field. This is undesirable.

Comments
EVALUATION The fix to 4465905 was necessary because components in a JEditorPane are removed and then re-added during layout. Fortunately, when 4522601 is fixed, this will no longer be an issue. Thus, upon fixing 4522601, the code which restores focus in BasicTextUI can be removed. ###@###.### 2001-11-02 The focus code that was causing this problem was removed as part of the fix to 4587627. Therefore, this bug is no longer an issue. Closing as a duplicate. ###@###.### 2002-01-07
07-01-2002