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

Provide way to set the JComboBox Editor Component

XMLWordPrintable

      Name: js151677 Date: 08/01/2004


      A DESCRIPTION OF THE REQUEST :
      Provide way to set the JComboBox Editor Component.

      A common thing to do is to want to change the EditorComponent for a JComboBox. In our case we want to use a JFormattedTextField as the editor component.

      The ComboBoxEditor interface has a method to get the EditorComponent but no method to set it. I understand that changing the ComboBoxEditor interface at this stage wont be possible, but maybe a way of providing is with this functionality would be to make an extended ComboBoxEditor interface, such that we have to cast to it in order to use the extra methods (in much the same way we do with Graphics2D).

      JUSTIFICATION :
      In order to change the EditorComponent at the moment we have to either use reflection in order to change the editor component, or extend all the different ComboBoxEditors for each look and feel (which isn't nice as we then can't use Look and Feels dynamically).

      Making our own ComboBoxEditor doesn't work either as different Look and Feels sometimes expect the ComboBoxEditor to take care of the border while other ones take care of the border in the JComboBox.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
        To be able to easily change the ComboBoxEditor.
      ACTUAL -
      Functionality doesn't exist.
      (Incident Review ID: 295457)
      ======================================================================

            Unassigned Unassigned
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: