将两个值添加到组合框
在c#中,我们可以向组合框的每个项目添加文本和值,我想知道在Java中也可以吗?如果没有请指教。
In c# we can add a text and a value to each items of combobox, I want to know is it possible in Java also? if not please advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过创建一个类解决了我的问题,
就像我从这个类创建一个新对象 一样将它传递给我的组合框
工作完成:)!
I Solved my problem by create a class like
than I just create a new object from this class & pass it to my combobox
job done :)!
您应该学习如何在 java 中使用 ComboBox 。
You should learn how to use ComboBox in java.