SplitButton in Java

本秂侑毒 提交于 2019-12-29 01:43:08

问题


Does anyone have a coded implementation of SplitButton?

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


回答1:


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)




回答2:


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



来源:https://stackoverflow.com/questions/11646290/splitbutton-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!