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

java.awt.List & java.awt.Choice should contain Objects not just Strings

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.0, 1.1
    • client-libs
    • None
    • x86, sparc
    • generic, windows_95, windows_nt



      Name: mc57594 Date: 03/13/97


      java.awt.List and java.AWT.Choice can only contain Strings.
      In most cases the labels that appear in the list are associated
      with other objects. For instance, a list may contain strings
      such as "red" and "blue" but the strings are associated by the
      application with Color objects.

      It would be much cleaner if java.awt.List and java.AWT.Choice
      would accept the actual non-String object. This would free the
      application from having to maintain the string to object mapping.
      All that would be required is that the objects that are added to
      the list return their desired label via toString(). There could
      be methods such as addObject and getObjectSelected to mirror
      addItem and getItemSelected.

      company - InfoServ Australia , email - ###@###.###
      ======================================================================

            xdengsunw Xianfa Deng (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: