Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to show the sub-menu accelerator icon indicator (arrow) on a top-level JMenu #867

Closed
AndreZeiler opened this issue Jul 11, 2024 · 3 comments
Milestone

Comments

@AndreZeiler
Copy link

Currently and in most other SWING L&Fs it is not possible to render the accelerator Icon in a JMenu if it is the TopLevelMenu (JMenu#isTopLevelMenu and FlatMenuItemRenderer#isTopLevelMenu).
But in some situations (I use a vertical JMenuBar with a mix of entries with and without sub-menus) it would be neat to have the possibility to show the accelerator icon even on the top level.

I previously worked around this situation, by defining the JMenus icon as the accelerator icon with a trailing/left icon position and a calculated icon gap (to align them). But because I now want to define a meaningful icon alongside the accelerator this is no longer possible.

Would be great to hear your opinion on this.

@DevCharly
Copy link
Collaborator

Sounds like a good idea.

I wonder how you create a vertical JMenuBar?

@AndreZeiler
Copy link
Author

I used a workaround because there is no "real" vertical option in the JMenuBar.
The JMenuBar uses a GridLayout with 0 rows and 1 column => JMenuBar#setLayout(new GridLayout(0, 1))
This workaround can be found here: https://www.tutorialspoint.com/how-to-create-a-vertical-menu-bar-in-java

@DevCharly
Copy link
Collaborator

implemented in latest 3.5-SNAPSHOT: https://github.com/JFormDesigner/FlatLaf#snapshots

@DevCharly DevCharly added this to the 3.5 milestone Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants