SplitButton in Java

4k Views Asked by At

Does anyone have a coded implementation of SplitButton?

I've tried searching some implementations but none of them work. (e.g. JSplitButton).

2

There are 2 best solutions below

1
On

You should try using a JComboBox. They work for more than just simple drop down, but it should do the trick.

1
On

Demo not working != splitButton not working :-)

splitButton = new JSplitButton("Split Button Demo");
splitButton.setPopupMenu(jPopupMenu2);
add(splitButton);

(Note: this is not a recommendation of that particular splitButton implementation, just a reminder that you should be a bit more careful in evaluating the projects you are finding. If you can't for some reason, you might consider using a commercial product, like Synthetica or JIDE, just to name two)