B
Brian J. Sayatovic
I'm looking for a swing button class that will act like the "view"
toolbar button in Explorer. It has a drop-down arrow embedded on its
right that, when specifically clicked, will display a drop down of
actions. When the remainder of the button is pressed, the default
action (one of those in the list) is performed.
Now, I've built something like this myself, already. It's a JPAnel
subclass that has two JButtons in it: a JButton with a settable Action
abd a drop-down arrow button. However, this is not the same
experience as using a real combo button. The borders must operate as
one.
I've started investigating how a JButton's borders are handled, but it
seems to be a maze of pluggable look and feel ComponentUI subclasses.
It is very frutrating. Every Swing tutorial I've checked out has
glossed over how the existing implementations work.
My other thought was to simply paint the component myself, but, there
is a lot of platform-specific logic behidn the painting of each
button. I don't want to duplicate that myself, and can't find a good
resource on how to take advantage of the PLAF work.
Any ideas on any of these fronts?
Regards,
Brian.
toolbar button in Explorer. It has a drop-down arrow embedded on its
right that, when specifically clicked, will display a drop down of
actions. When the remainder of the button is pressed, the default
action (one of those in the list) is performed.
Now, I've built something like this myself, already. It's a JPAnel
subclass that has two JButtons in it: a JButton with a settable Action
abd a drop-down arrow button. However, this is not the same
experience as using a real combo button. The borders must operate as
one.
I've started investigating how a JButton's borders are handled, but it
seems to be a maze of pluggable look and feel ComponentUI subclasses.
It is very frutrating. Every Swing tutorial I've checked out has
glossed over how the existing implementations work.
My other thought was to simply paint the component myself, but, there
is a lot of platform-specific logic behidn the painting of each
button. I don't want to duplicate that myself, and can't find a good
resource on how to take advantage of the PLAF work.
Any ideas on any of these fronts?
Regards,
Brian.