- 
    Type:
Bug
 - 
    Resolution: Cannot Reproduce
 - 
    Priority:
  P4                     
     - 
    None
 - 
    Affects Version/s: 1.4.2
 - 
    Component/s: client-libs
 
- 
        generic
 - 
        generic
 
                    Name: dmR10075			Date: 08/15/2002
Here is the test case:
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame {
public static void main(String[] args) {
new Test();
}
public Test() {
super("Test for mnemonics");
getContentPane().setLayout(new FlowLayout());
JButton b = new JButton("press");
getContentPane().add(b);
b = new JButton("press 2");
getContentPane().add(b);
pack();
setVisible(true);
try {
Thread.sleep(1000);
} catch (Exception e) {
}
b.requestFocus();
getContentPane().remove(b);
}
}
Compile it and run. You will see that frame has one button and no
visible focus owner. But in fact there is a focus owner - it is
component which is not currently in a frame, it has isShowing() ==
false. In this case, with 1.4.1, mnemonics doesn't work.
>From documentation it is not stated that the program above does
anything wrong but we see two problems - mnemonics doesn't work and
focus owner is actually not isShowing() - and these problems should be
solved.
======================================================================
            
Here is the test case:
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame {
public static void main(String[] args) {
new Test();
}
public Test() {
super("Test for mnemonics");
getContentPane().setLayout(new FlowLayout());
JButton b = new JButton("press");
getContentPane().add(b);
b = new JButton("press 2");
getContentPane().add(b);
pack();
setVisible(true);
try {
Thread.sleep(1000);
} catch (Exception e) {
}
b.requestFocus();
getContentPane().remove(b);
}
}
Compile it and run. You will see that frame has one button and no
visible focus owner. But in fact there is a focus owner - it is
component which is not currently in a frame, it has isShowing() ==
false. In this case, with 1.4.1, mnemonics doesn't work.
>From documentation it is not stated that the program above does
anything wrong but we see two problems - mnemonics doesn't work and
focus owner is actually not isShowing() - and these problems should be
solved.
======================================================================
- relates to
 - 
                    
JDK-6469530 Memory leak in the focus subsystem
-         
     - Closed
 
 -         
 - 
                    
JDK-6217590 Autotransfer moves focus to removed component
-         
     - Closed
 
 -         
 - 
                    
JDK-6321947 GC does not complete after Frame.dispose() until focus/unfocus of another Frame
-         
     - Closed
 
 -