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

Use generic in Swing components like JComboBox

XMLWordPrintable

    • Fix Understood
    • x86
    • linux, windows_2000

      A DESCRIPTION OF THE REQUEST :
      Add generics support to Swing components like JComboBox and JList:

      JComboBox<String> combo = new JComboBox<String>(...);

      String str = combo.getSelectedItem();

      JUSTIFICATION :
      Type safety in getSelectedItem().

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No cast required for getSelectedItem
      ACTUAL -
      Does not apply

      ---------- BEGIN SOURCE ----------
      See above
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      casting

            psadhukhan Prasanta Sadhukhan
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: