简体   繁体   English

如何在Java中编写DropDownButton代码

[英]How to code a DropDownButton in Java

I need to create a button like this in Java: 我需要在Java中创建这样的按钮:

ContextMenuButton

You can click on the left part of the button for a normal button action and you can click on the arrow on the right to open a drop down menu. 您可以单击按钮的左侧部分进行常规按钮操作,然后单击右侧的箭头打开下拉菜单。

Is it possible to create something like this in java? 是否有可能在java中创建这样的东西? Thanks! 谢谢!

In this tutorial the writer shows how to create a button and have a drop down appear next to it when it is clicked. 在本教程中,作者将演示如何创建按钮,并在单击按钮时在其旁边显示一个下拉列表。 This looks a lot like what you try to achieve. 这看起来很像你想要实现的。 Hope this helps. 希望这可以帮助。

http://java.dzone.com/news/drop-down-buttons-swing-new-al http://java.dzone.com/news/drop-down-buttons-swing-new-al

The split button might provide a simpler solution if the Gnu Lesser GPL is ok for you 如果Gnu Lesser GPL对您没问题,拆分按钮可能会提供更简单的解决方案

http://code.google.com/p/jsplitbutton/ http://code.google.com/p/jsplitbutton/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM