Home > Database > Mysql Tutorial > mysql-About the text box input problem of java swing

mysql-About the text box input problem of java swing

WBOY
Release: 2016-09-15 11:14:44
Original
1076 people have browsed it

mysqljava

I am making an electronic dictionary and want to implement the input pre-completion function. For example, if you input win, words such as wind and window will appear. After looking at examples online, I still can’t do it. I hope the great god can give me some advice. The database is mysql. I am very grateful!

Reply content:

http://www.cnblogs.com/lovesqcc/p/4037708.html

This example is very good, I have practiced it myself.
Just comment out MapUtil.printMap(wordMatcher.obtainPrefixMatchers()); in the document and it will work. You can refer to the running results:
mysql-About the text box input problem of java swing

I personally think it can be like this: when you enter information in the text box, each time you enter a letter, it is equivalent to a click event. Use ajax to access the background, perform a fuzzy query on the database, and then display the returned data.

Personally, I think querying the database is not a good solution. It is relatively slow and the user inputs frequently, which results in more queries. Is it possible to adopt a caching strategy?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template