我有一个名称字符串数组,然后将其添加到可编辑的 JComboBox 中。
用户可以从选项中选择他/她的名字,或者如果不在选项中,则只输入他/她的名字。
如何将用户输入放入新的字符串变量中?
String [] chooseName = { Mark, John, Allison, Jessica };
JComboBox combo = new JComboBox (chooseName);
combo.setEditable(true);
String chosenName = /* how do i place what the user inputed here? */