Java的自动完成文本字段(阿贾克斯风格) [英] Java Autocomplete TextField (Ajax style)

查看:250
本文介绍了Java的自动完成文本字段(阿贾克斯风格)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个JTextField(或任何组件在那里我可以输入一些东西),它必须提供dynamicaly填充值的列表。当我输入一个新的角色,命题被更新(如AJAX一样)

I need to create a JTextField (or any component where I can type something) and it has to offer a list of dynamicaly populated values. When I type a new character, the propositions are updated (Like Ajax does)

一特点是,用户只能选择被填充的值。我需要为我的用户从数据库中选择一个现有的城市。

One particularity is that the user can only choose a value that was populated. I need that for my users to select an existing city from a database.

什么是与摆动使其成为最简单的方法是什么?

What would be the easiest way to make it with Swing ?

感谢你。

推荐答案

我已经使用了 JIDE常见层的自动完成在的Java Swing。看看在 Webstart的演示

I have used the JIDE Common Layer for autocompletion in Java Swing. Take a look at the WebStart demo.

这是免费的,开源的,如果提供的自动完成选项不完全匹配,你正在做什么,我发现它真的很容易在自己的逻辑来堵塞。

It's free and open source, and if the provided autocompletion options don't quite match what you are trying to do I found it really easy to plug in my own logic.

这篇关于Java的自动完成文本字段(阿贾克斯风格)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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