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

SetMnemonic should be case-sensitive

XMLWordPrintable

    • beta
    • generic, x86
    • generic, solaris_2.6, windows_nt

      In the entries: Mark Done, Mark ToDo, Mark Rejected,
      setting mnemonics to D, T, and R, respectivly produce:
         Mark Done
              -
         Mark ToDo
              -
         Mark Rejected
           -
      The specified mnemonic was upper case R, though, and that
      would be the preferred character to underline.

      Name: krT82822 Date: 08/17/99


      In the following example (and similarly with other components) you cannot specify the correct character to underline:

      JLabel label = new JLabel ("Save As...");
      label.setDisplayedMnemonic ('A');

      The 'A' in 'As' should be underlined (that's the intention at least), but the 'a' in 'Save' is what gets underlined.

      The problem (aside from the lack of an API to specify exactly what should be underlined) is in the javax.swing.plaf.basic.BasicGraphicUtils drawString method which underlines the first character (upper OR lowercase) that matches the mnemonic character.
      (Review ID: 94042)
      ======================================================================

            peterz Peter Zhelezniakov
            earmstrosunw Eric Armstrong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: