posted 22 years ago
Hi Christopher,
welcome to JavaRanch. Your requested feature doesn't work with a Mnemonic, because a mnemonic consists of the ALT button and a letter, which is part of the buttons text, but there are lots of workarounds possible.
One thing, which I like is a non visible JMenuItem. This can have your requested button as an Accelerator.
Another possibility is, that your main application (JFrame) listens for all key events and if PF9 is pressed, then you can do your action.
But it will not work if your JButton will listen for PF9.
Hope that helps
Rene