从JComboBox获取输入值 [英] Get input values from JComboBox

查看:525
本文介绍了从JComboBox获取输入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取可编辑的 JComboBox 的输入。当用户给组合输入如何从中获取输入文本时?

How can I get the input for an editable JComboBox. When user gives an input to the combo how I can get the input text from it?

推荐答案

您需要获取编辑后的文本从组合框编辑器通过 组合.getEditor()。getItem()

You need to get the edited text from the combobox editor via combo.getEditor().getItem().

这篇关于从JComboBox获取输入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆