Hello, I wanna search for my customer name, using fast ajax, every sensitive code that I type on my JTextfield, it's automatically search in my database and fetch the other rows out which is like the keyword.
:) is it call ajax?
Printable View
Hello, I wanna search for my customer name, using fast ajax, every sensitive code that I type on my JTextfield, it's automatically search in my database and fetch the other rows out which is like the keyword.
:) is it call ajax?
AJAX stands for Asynchronous Javascript and is a web applications trick for fooling users into thinking that they are getting their pages refreshed without a submit to the server.
It has nothing to do with a JTextfield because that is a swing component which cannot be used in web applications.
You are going to have to implement it all using Java.
Just put a listener for the key presses on the JTextfield and call a refresh method that updates whatever needs to be updated with data from the database.
.... or a DocumentListener if you want to listen for paste/cut events as well.
any suggestions for Events in Netbeans? :D
I see..great palz
Events have nothing to do with Netbeans. Remember that Netbeans is just a tool where you can write code. How you write the code should not have anything to do with whether you used Netbeans, Eclipse or notepad. In fact if you are still learning the Java basics I would suggest not using any IDE at all and just sticking to Textpad or notepad++.
Here is the tutorial link to get you started with writing KeyListeners.
but I must use IDE palz, it's about deadline of this project :(
I wanna make search textField like this :
http://img35.imageshack.us/img35/1807/ajaxr.jpg
As you can see then the IDE is now getting into your way and actually preventing you from meeting your deadline. Writing event listeners is not very complicated but if you have lots of code generated for you by the IDE and you are fairly new to Java then you would find it difficult to integrate your code into the IDE's code.
Better read the tutorial link I posted, try some code and post if you get problems with your code.
is it means, everytime I press on keyboard, it automatically search the database?
how to make the GUI like drop down on google in Java? :p
You can use an actual drop down. A Combobox.