例如,Libre Office 有一个带下拉菜单的按钮,但它不是组合框:
Swing 是否有类似的模拟器或功能?
Java没有提供SplitButton的实现。 我在潜在的实现评论中提供了链接到该网站上的另一个问题,并且还要添加,Jidesoft在其开源JIDE Common Layer中也有一个SplitButton的实现,请先检查许可证。
arrow_down.png
是指向下的黑色箭头)button = new JButton();
button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/icons/arrow_down.png")));
button.setBorderPainted(false);
button.setFocusPainted(false);
button.setContentAreaFilled(false);