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

RFE: JOptionPane using initialValue when options is null

XMLWordPrintable



      Name: rmT116609 Date: 03/13/2003


      A DESCRIPTION OF THE REQUEST :
      The problem is that for the JOptionPane showXXX methods that accept an initialValue parameter, the initialValue is ignored unless the options parameter is also specified. The result of this is that you cannot specify which button has initial focus if you want to use the "default" buttons provided by the Look&Feel.

      JUSTIFICATION :
      It is not equivalent to manually specify the button names because (a) that is look&feel specific, and (b) doing so loses the mnemonics (underscores).

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Since the initialValue is an object, if you could specify an initialValue of "new Integer(JOptionPane.NO_OPTION)" and leave the options parameter as null, to make the L&F-defined "NO" button the default, that would be great. This would not infringe on use of either String or Component objects as the initialValue, nor would it infringe meaningfully on the behavior of converting other objects to Strings.
      Right now, per Bug Id 4206368, initialValue is ignored if options is null.
      (Review ID: 182584)
      ======================================================================

            Unassigned Unassigned
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: