Insert list of values to JTextField with Java2sAutoTextField
I want th auto generate values for the empId (or empName) when inserting values to the jtextfield
I went through the Java2sAutoTextField
class but I can't add it in to a jframe.
Here's a part of code I extracted from here:
List possible = new ArrayList();
possible.add("Austria");
possible.add("Italy");
possible.add("Croatia");
possible.add("Hungary");
Java2sAutoTextField autoCompleter = new Java2sAutoTextField(possible);
i dont know how to put the above coding into the jtextfi开发者_如何学JAVAeld
Also I tried out JSuggestField
, but I can't add it from netbeans palette.
Done! i just had to implement the jtextfield as
List possible = new ArrayList();
possible.add("");
possible.add("Austria");
possible.add("Italy");
possible.add("Croatia");
possible.add("Hungary");
jTextField2 = new Java2sAutoTextField(possible);
精彩评论