我有一个文本字段粘贴到jList1,我需要过滤j列表实体依赖于用户在文本框中输入的值,如下所示,如果j列表值,{"one","two","three"......etc }
如果用户在文本框中输入"三",弹出列表并选择具有三个值的行到选定的相关索引.
private void jTbandnoActionPerformed(java.awt.event.ActionEvent evt)
{
// TODO add your handling code here:
String tXT=jTbandno.getText();
jList2.collections.equal(tXt);
int index = jList2.getSelectedIndex();
JOptionPane.showMessageDialog(null, index);
}
Run Code Online (Sandbox Code Playgroud) 我想知道相同的事件,如VB中的更改事件我有文本框字段,我想在用户进行任何更改后触发代码,在文本框值中,我需要知道如何将监听器粘贴到我的文本框中我正在使用KeyReleased事件.
private void jTsearchKeyReleased(java.awt.event.KeyEvent evt) {
String jtr=jTsearch.getText();
Boolean Txtval=StringUtils.isNumeric(jtr);
if (Txtval=false)
// my code will come here
}
}
Run Code Online (Sandbox Code Playgroud)