带有可编辑文本字段和列表的 JOptionPane 对话框
是否可以创建一个对话框,用户可以在其中从列表中选择值,但也可以编辑文本? (类似于带有可编辑 JComboBox 的对话框。)
Is it possible to create a dialog where the user can select values from a list, but also can edit the text?
(Something like a dialog with an editable JComboBox.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
JDialog 通常用于向用户显示通知。我认为如果您想要这样的行为,您将必须创建一个简单的 JFrame 来满足您的需要。
JDialogs are usually used to display notifications to the user. I think that if you want such behaviour you will have to create a simple JFrame that does what you need.
不确定“选择后编辑文本”是什么意思。
但是,您可以使用 JOptionPane 轻松创建简单的对话框。您可以将 JPanel 添加到选项窗格。请查看对话框焦点了解更多信息。
Not sure what you mean by "edit the text after selection".
However, you can easily create a simple dialog using a JOptionPane. You can add a JPanel to the option pane. Check out Dialog Focus for more information.