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

JOptionPane.showInternalInputDialog() throws ClassCastException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • client-libs



      Name: skT88420 Date: 04/19/99


      Using the version of JOptionPane.showInternalInputDialog() that
      allows to specify selection values (selectionValues parameter)
      throws a ClassCastException if the Object[] array contains
      anything other than String objects.

      This is caused by the last line of that method, which casts the
      value selected by the user to a String before returning it.

      Obviously this is wrong as it is in contradiction with the
      documentation of the class, and it causes a behavior that is
      different than with JOptionPane.showInputDialog(), which works
      fine with any type of objects.

      ******** Test code included in the comments ********
      (Review ID: 54249)
      ======================================================================

            amfowler Anne Fowler (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: