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

JOptionPane doesn't like Uppercase

XMLWordPrintable

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

      G'day,

      I'm currently trying to use the very straightforward
      JOptionPane.showXXXDialogs - in particular, showMessageDialog.

      Here is the code:

      ---8<-------------------------------------------------------

      // *** Note: Doesn't like Uppercase here... button label appears as "---"
        Object options[] = {"OK"};
        JOptionPane.showOptionDialog(parentFrame,
                                     aboutInfo,
                                     aboutTitle,
                                     JOptionPane.INFORMATION_MESSAGE,
                                     JOptionPane.DEFAULT_OPTION,
                                     aboutIcon,
                                     options,
                                     options[0]
                                     );

      ---8<-------------------------------------------------------


      The dialog shows up fine. However, there are two problems:

        1) The "OK" on the button appears as "---". If I change the case
           of any of the letters is appears e.g. "Ok" appears as "Ok". This
           even happens with some of the demos. I'm beginning to wonder if it's
           a font-funny on this machine (unfortunately, I haven't run it anywhere
      else).

        2) I display some lines on the dialog box (it's my "About..." box) - the
           usual stuff. However, I pull these lines from a properties file which
           embeds "\n" to break the lines up. Once the lines are processed into
           a "String[]" and passed to the dialog the longest line is truncated. It
           just so happens that the longest line is the 2nd line to display as the
           dialog seems to truncate the lines according to the length of the first.
           I tried making the first line longer than the 2nd and indeed, all is well.

            amfowler Anne Fowler (Inactive)
            rkarsunw Ralph Kar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: