Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8173744

JComboBox Popup disappears immediately when clicking on a certain region

    XMLWordPrintable

Details

    Description

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      A JComboBox popup disappears immediately when clicking on the bottommost or rightmost line of the comboBox.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      The issue can be easily reproduced when the Metal Look And Feel is set. Simply click on the bottommost or rightmost line of a JComboBox. As soon as the mouse button is released the popup disappears. It's best reproducible with a non-editable comboBox - however, editable comboBoxes are affected too.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The JComboBox popup should appear and stay open when the mouse button is released.
      ACTUAL -
      The popup window is immediately closed as sson as the mouse button is released

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      A workaround is pretty hard to implement. The issue is caused by a wrong area check in javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(...)

      Unfortunately the rectangle size is not correctly set:
        Rectangle bounds = new Rectangle( 0, 0, size.width - 1, size.height - 1 );

      The issue can be easily fixed by removing the "-1" value just like below.
        Rectangle bounds = new Rectangle( 0, 0, size.width, size.height);




      Attachments

        Issue Links

          Activity

            People

              psadhukhan Prasanta Sadhukhan
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: