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

Button Group #635

Open
ebourg opened this issue Jan 7, 2023 · 1 comment
Open

Button Group #635

ebourg opened this issue Jan 7, 2023 · 1 comment

Comments

@ebourg
Copy link
Contributor

ebourg commented Jan 7, 2023

Several UI toolkits have a concept of button groups, where adjacent buttons share their borders, for example:

It looks like this:
image

It would be great to have something similar in FlatLaf. I'm not sure how this could be implemented though. Maybe supporting rounded corners only on the left or on the right would be a first step, and then the layout could be configured such that the inner borders are superposed.

@gk-brown
Copy link

gk-brown commented Aug 11, 2023

Would something like this (using JToggleButton and ButtonGroup) work?

button-group

Source code is available here. This example uses a lightweight library I wrote to simplify layout, but that's not strictly necessary. The icons are instances of FlatLaf's FlatSVGIcon class, and the border is an instance of FlatLineBorder. The buttons are styled using the "toolBarButton" client property.

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