Question

I've noticed that on some macs the JMenuItem uses the word "space" to indicate that the space bar is the key binding. On other macs a symbol is used (looks like a short capital U). I'd prefer the "space" presentation since it's more transparent to users. Is there any way to override how the LAF graphically represents the accelerator key?

Was it helpful?

Solution

You can subclass BasicMenuItemUI and override the paintMenuItem() method. There you can draw your own accelerator. I would love a animated image as accelerator :)

(Note If you simply want to change the mneonic or accelerator then you can directly use setAccelerator() or other set methods. But I am assuming this is not the case.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top