JDK-4673367 : 1.4 REGRESSION: Up/down arrow keys in Combo box for Win LAF opens popup portion
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2002-04-23
  • Updated: 2003-04-12
  • Resolved: 2002-08-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2 mantisFixed
Related Reports
Relates :  
Description

Name: gm110360			Date: 04/23/2002


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


FULL OPERATING SYSTEM VERSION : Windows NT Version 4.0


A DESCRIPTION OF THE PROBLEM :
Combo box does not behave in 1.4 the same it used to in 1.3
when “windows look and feel” is used.

If Up or Down arrows are used with combo box, the selected
item should change to the next/prev item in the list (and
it worked correctly in 1.3).

If Down arrow is pressed with 1.4 java, a pull-down list
opens. When Up arrow is pressed with 1.4 java, nothing
happens.

REGRESSION.  Last worked in version 1.3.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Display a Frame with a combo box that has
items "A", "B", "C"
2. Focus a combo box and select an item "B"
3. Press Up and observe that nothing happened
4. Press Down arrow and observe that pull - down list got
opened

EXPECTED VERSUS ACTUAL BEHAVIOR :
I expected selection to swith to the next item in the list
when arrow keys are used

This bug can be reproduced always.

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

public class ComboBoxTest
{
  public static void main(String[] args)
  {
    try
    {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
    catch (Exception exc)
    {
    }

    ComboBoxTest comboBoxTest1 = new ComboBoxTest();

    Vector v = new Vector();
    v.add("A");
    v.add("B");
    v.add("C");

    JComboBox cb = new JComboBox(v);

    JFrame frame = new JFrame();
    frame.getContentPane().setLayout(new FlowLayout());

    frame.getContentPane().add(cb);

    frame.addWindowListener(new WindowAdapter()
    {
      public void windowClosing(WindowEvent e)
      {
        System.exit(0);
      }
    });

    frame.setBounds(100, 100, 300, 70);
    frame.setVisible(true);
  }
}
---------- END SOURCE ----------

Release Regression From : 1.3.1_03
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: 139673) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis mantis-b02 FIXED IN: mantis mantis-b02 INTEGRATED IN: mantis mantis-b02
14-06-2004

PUBLIC COMMENTS Fixed for 1.4.2
10-06-2004

EVALUATION This regression was introduced in the 1.4.beta. The custom Windows Up and Down arrow actions are intact but not used. The fix to 4306584 in which BasicComboBoxUI.getActionMap() will not register the "ComboBox.actionMap" on the UIManager. When the WindowsComboBoxUI tries to register its own UpAction and DownAction in the ComboBox.actionMap, it can't find it so the actions aren't registered. ###@###.### 2002-05-08 The suggested fix is incorrect. The ActionMap cannot be shared since the HidePopupAction cannot be shared for all combo boxes. The real fix is for WindowsComboBoxUI to get the instance action map and override the "selectPrevious" and "selectNext" entries. I also found a design flaw when I fixed this bug: In Windows, editable combo boxes should display the popup when the up and down arrow is pressed. The current implementation (which was unreachable in 1.4) the up and down arrows are a no-op. ###@###.### 2002-06-24
24-06-2002

SUGGESTED FIX Restore the method BasicComboBoxUI.getActionMap() to version 1.135: ActionMap getActionMap() { ActionMap map = (ActionMap)UIManager.get("ComboBox.actionMap"); if (map == null) { map = createActionMap(); if (map != null) { UIManager.getLookAndFeelDefaults().put("ComboBox.actionMap", map); } } return map; } ###@###.### 2002-05-08 In the overloaded WindowsComboBoxUI.installKeyboardActions, install the new Action on the instance ActionMap. ###@###.### 2002-06-24
08-05-2002