Results 1 to 9 of 9
  1. #1
    sysout is offline Member
    Join Date
    Aug 2009
    Posts
    66
    Rep Power
    0

    Default JTextfield Ajax Searching

    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?

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    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.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  4. #4
    sysout is offline Member
    Join Date
    Aug 2009
    Posts
    66
    Rep Power
    0

    Default

    any suggestions for Events in Netbeans? :D

    I see..great palz

  5. #5
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    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.

  6. #6
    sysout is offline Member
    Join Date
    Aug 2009
    Posts
    66
    Rep Power
    0

    Default

    Quote Originally Posted by r035198x View Post
    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 :

    Last edited by sysout; 08-30-2009 at 02:36 PM.

  7. #7
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    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.

  8. #8
    sysout is offline Member
    Join Date
    Aug 2009
    Posts
    66
    Rep Power
    0

    Default

    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

  9. #9
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

Similar Threads

  1. Replies: 1
    Last Post: 01-30-2009, 06:44 PM
  2. Jsp with Ajax
    By sundarjothi in forum JavaServer Pages (JSP) and JSTL
    Replies: 16
    Last Post: 09-25-2008, 10:29 AM
  3. AJAX in JSP
    By haiforhussain in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 07-01-2008, 02:12 PM
  4. Example for Ajax-JSP
    By smrithi in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 06-02-2008, 02:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •