JDK-4762793 : REGRESSION: Alt-key mnemonic underlines don't show up after JOptionPane shown
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-10-14
  • Updated: 2002-10-24
  • Resolved: 2002-10-24
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 10/14/2002


FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)


FULL OPERATING SYSTEM VERSION :

Microsoft Windows 2000 [Version 5.00.2195]


EXTRA RELEVANT SYSTEM CONFIGURATION :
"Hide mnemonics until press the Alt key" is turned on.

A DESCRIPTION OF THE PROBLEM :
I have the system set up not to display mnemonics until I
press Alt.  The problem is that if I show a JOptionPane
over the frame, then close the JOptionPane, the mnemonics
don't show up at all, even if Alt is pressed.  The
mnemonics still work, moving focus around, but you can't
see them.  This appears to be a regression from 1.4.0_02.

REGRESSION.  Last worked in version 1.4

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile the included program
2. Run it
3. Click the button without pressing the Alt key
4. Close the message box
5. Press the Alt key

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected results: mnemonics show up.
Actual results: They don't.

If Alt is pressed before the message box is shown, then the
mnemonics show up and it works as expected.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

public class Underline implements ActionListener
{
    public static void main (String[] args)
    {
        try {
            UIManager.setLookAndFeel
("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        }
        catch (Exception e) {
            System.out.println ("Could not set Windows Look & Feel");
        }

        JFrame frame = new JFrame("Frame");

        Container conPane = frame.getContentPane();
        conPane.setLayout(new FlowLayout());

        JLabel l1 = new JLabel("Label");
        conPane.add(l1);

        JTextField l2 = new JTextField("Text field");
        conPane.add(l2);

        l1.setLabelFor(l2);
        l1.setDisplayedMnemonic('L');

        JButton l3 = new JButton("Show dialog box");
        l3.setMnemonic('S');
        conPane.add(l3);
        l3.addActionListener(new Underline());

        frame.pack();
        frame.show();
    }

    public void actionPerformed(ActionEvent a)
    {
        JOptionPane.showMessageDialog(null, "Ha ha, now it won't work!");
    }
}

---------- END SOURCE ----------

Release Regression From : 1.4.0_02
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 165674) 
======================================================================

Comments
EVALUATION This is likely a duplicate of another bug and should be fixed for mantis. ###@###.### 2002-10-18 Name: azR10139 Date: 10/24/2002 This bug is duplicate of 4736093. Suggested fix for bug 4736093 eliminates this problem. ###@###.### 10/24/2002 ======================================================================
24-10-2002