A DESCRIPTION OF THE REGRESSION :
Create frame with one button on it.
Set button's ActionListener to open new FileChooser with null parent.
Run application.
Press the button, file chooser opens.
Close it.
REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
public class TestApp {
public static void main(String[] args) {
final JFrame frame = new JFrame();
frame.setSize(100, 100);
final JButton button = new JButton("Browse");
button.setMnemonic('b');
frame.getContentPane().add(button);
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
fileChooser.showOpenDialog(null);
}});
frame.addWindowListener(new WindowListener(){
public void windowActivated(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
public void windowClosing(WindowEvent e) {
frame.dispose();
System.exit(0);
}
public void windowDeactivated(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowOpened(WindowEvent e) {}
});
frame.show();
}
}
RELEASE LAST WORKED:
5.0 Update 6
RELEASE TEST FAILS:
mustang-b72
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Focus returns to pressed button.
ACTUAL -
Button is not focused.
This occurred between builds 1.6 b58 and b59. I also tested this on Windows XP using JOptionPane.showMessageDialog(...) and JFrame(), but this seems to only happen as stated by the user when you are using the JFileChooser showOpenDialog(null) method with a null.