jdk icon indicating copy to clipboard operation
jdk copied to clipboard

4850101: Setting mnemonic to VK_F4 underlines the letter S in a button.

Open prsadhuk opened this issue 3 years ago • 5 comments
trafficstars

It is seen that using VK_F4 in JButton's setMnemonic(int i), causes the letter 'S' in the JButton to be underlined if JButton's text has 'S' in its string. This is because VK_F4 keycode is 0x73 (115 in decimal) which happens to be value of lowercase 's' so as per the logic implemented in SwingUtilities.findDisplayedMnemonicIndex(), the first index of the character (either lowecasr or uppercase) is returned as a mnemonic, which gets underlined.

Fix is made to ignore Action Keys from VK_F1->VK_F11 as displayed mnemonic which corresponds to lowercase p->z


Progress

  • [x] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-4850101: Setting mnemonic to VK_F4 underlines the letter S in a button.

Reviewers

  • @AJ1032480 (no known github.com user name / role)
  • Phil Race (@prrace - Reviewer)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9712/head:pull/9712
$ git checkout pull/9712

Update a local copy of the PR:
$ git checkout pull/9712
$ git pull https://git.openjdk.org/jdk pull/9712/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9712

View PR using the GUI difftool:
$ git pr show -t 9712

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9712.diff

prsadhuk avatar Aug 02 '22 10:08 prsadhuk

:wave: Welcome back psadhukhan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Aug 02 '22 10:08 bridgekeeper[bot]

@prsadhuk The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

openjdk[bot] avatar Aug 02 '22 10:08 openjdk[bot]

Webrevs

mlbridge[bot] avatar Aug 02 '22 10:08 mlbridge[bot]

@prsadhuk This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

4850101: Setting mnemonic to VK_F4 underlines the letter S in a button.

Reviewed-by: prr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 428 new commits pushed to the master branch:

  • da477b13661b39e1f48b674f7fd9ea1d26521fc3: 8292509: ProblemList java/lang/invoke/lambda/LogGeneratedClassesTest.java on windows
  • 01b87ba8e2c48ad29c1f4771973ebbe938967448: 8289616: Drop use of Thread.stop in AppContext
  • e44e3f0c1976a513c6637545f49f49de84cbac02: 8289106: Add model of class file versions to core reflection
  • c3d3662e52de434adb267485982fbf8541bdc0c8: 8292313: 2 runtime/cds/appcds tests fail after JDK-8284313
  • 3e122419b2979235f57c0dd549ca63647ea73753: 8290775: Some doc errors in DerOutputStream.java
  • ec53fba03933446024028555b87c6023895a5dc6: 8292361: Build failure on PPC64 BE after JDK-8290840
  • 4cc6cb9d9ddbcc540baac7b81398f2af83f93340: 8290041: ModuleDescriptor.hashCode is inconsistent
  • d1edda8ff52e172a85d102d7d5062b9cc401beea: 8292338: aarch64: Use cbnz instruction in gen_continuation_enter when possible
  • 21f4eb2233a95be44a5db59b7791cd952ddbd56e: 6521141: DebugGraphics NPE @ setFont();
  • 6e6ae596d6bd73909b90911e01fbd0c16f6335e1: 8292286: Convert PlaceholderTable to ResourceHashtable
  • ... and 418 more: https://git.openjdk.org/jdk/compare/46251bc6e248a19e8d78173ff8d0502c68ee1acb...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

openjdk[bot] avatar Aug 04 '22 20:08 openjdk[bot]

Mailing list message from Patrick Chen on client-libs-dev:

is it the only case ? is there other keycode with the same issue?

Le mar. 2 ao?t 2022 ? 12:47, Prasanta Sadhukhan <psadhukhan at openjdk.org> a ?crit :

-------------- next part -------------- An HTML attachment was scrubbed... URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20220802/cb2b6570/attachment-0001.htm>

mlbridge[bot] avatar Aug 11 '22 09:08 mlbridge[bot]

@prrace The code is changed since last approved..Do you have any objection?

prsadhuk avatar Aug 18 '22 12:08 prsadhuk

/integrate

prsadhuk avatar Sep 07 '22 12:09 prsadhuk

Going to push as commit d6961045353897967bb734740225bd1cddf158e5. Since your change was applied there have been 693 commits pushed to the master branch:

  • 14fd1b6cdfc2f912d350ac0da07f3fe4b1f976e0: 8292921: Rewrite object field printer
  • 4f9065d3d5e914f8e89daf1ff27bba3578b19e20: 8293333: Broken links in JDI specification
  • 2259e427a53440da948315db2272396294036051: 8293197: Avoid double racy reads from non-volatile fields in SharedSecrets
  • 205f992e9ecf9f83bb052ee2e2a32e3f532c5ac9: 8293326: jdk/sun/security/tools/jarsigner/compatibility/SignTwice.java slow on Windows
  • 710a14347344f3cc136f3b7f41aad231fbe43625: 8293445: clhsdb "thread" command gives incorrect error message for bad threadID
  • 57930f8e53e85bd923127bd638286898cfe3b117: 8293285: x86_64: Move libm stub implementations to StubGenerator
  • 5b4c415510cbd1b34217c976006ea900d5917f46: 8293254: x86_64: Extract arraycopy stub implementations into a separate file
  • fb6eb6f26728d379fe666ac87630236f58065bbe: 8293245: x86_64: Extract Adler32 stub implementation into stubGenerator_x86_64_adler.cpp
  • da596182a494a36d37030f18328e52e525fc3565: 8264744: (fs) Use file cloning in Linux version of Files::copy method
  • 85d4b49151e9529051f1ed344749a487d3e92165: 8283929: GHA: Add RISC-V build config
  • ... and 683 more: https://git.openjdk.org/jdk/compare/46251bc6e248a19e8d78173ff8d0502c68ee1acb...master

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Sep 07 '22 12:09 openjdk[bot]

@prsadhuk Pushed as commit d6961045353897967bb734740225bd1cddf158e5.

:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

openjdk[bot] avatar Sep 07 '22 12:09 openjdk[bot]