Results 1 to 10 of 10
  1. #1
    Join Date
    May 2008
    Location
    India,Kolkatta
    Posts
    50
    Rep Power
    0

    Default [SOLVED] Auto complete Text.

    Hi All,

    I need a suggestion or code for Auto Complete Text in JTextField.

    Thanks in advance..

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    You have to use the key listener event for this. Each keyPressed event you can validate the letter with already stored data. When you do this for each key press by the user you can find the word.

  3. #3
    Join Date
    May 2008
    Location
    India,Kolkatta
    Posts
    50
    Rep Power
    0

    Default

    Ok let me see..

    Thanks..

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  5. #5
    Join Date
    May 2008
    Location
    India,Kolkatta
    Posts
    50
    Rep Power
    0

    Default

    Ya tried using key event.
    Using key event i can catch the first character but how to match with the string and before that how to make String dynamic so that it will apeend the text inside it as many time the application is executed.
    now i am trying to store the text in notepad and whenever the alphabet is type it will show the value from the notepad..
    i dont know wheather it will work or not..
    i need your help..

    Thanks for your concern...

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Actually no need to use a notepad. By the code you can do it. Each newly typed word store in a List. Then on each key event go through the List and compare the same indexing character of user entered word and the searched word of the List.

  7. #7
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Hi All,

    I need a suggestion or code for Auto Complete Text in JTextField.

    Thanks in advance..
    Gather/Collect data.
    Compare each data that was gathered,
    show the desired data.

    If your data are only basic texts, you can use compareToIgnoreCase(String str) method.
    If they are locale dependent, use Collator class then set the Collator's strength.
    freedom exists in the world of ideas

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  9. #9
    Join Date
    May 2008
    Location
    India,Kolkatta
    Posts
    50
    Rep Power
    0

    Default

    hi all,
    I solve my problem by using AutoComplete JCombo box.

    Thank you all..
    Thanks & Regards
    Subroto Bhattacharjee:)

  10. #10
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Replies: 0
    Last Post: 05-26-2008, 05:26 PM
  2. IDE with auto completion?
    By iceflyin in forum New To Java
    Replies: 8
    Last Post: 04-21-2008, 02:07 PM
  3. Replies: 2
    Last Post: 03-10-2008, 01:24 PM
  4. Error : Runnable did not complete within 10000ms
    By piyushgpt1 in forum Advanced Java
    Replies: 1
    Last Post: 02-05-2008, 08:04 PM
  5. help to complete final part of project
    By dirtycash in forum New To Java
    Replies: 6
    Last Post: 12-31-2007, 07:21 AM

Posting Permissions

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