开发者

Insert list of values to JTextField with Java2sAutoTextField

开发者 https://www.devze.com 2023-01-15 04:05 出处:网络
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.

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.

Any assistance is appreciated.


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号