Results 1 to 7 of 7
  1. #1
    radix is offline Member
    Join Date
    Nov 2008
    Posts
    10
    Rep Power
    0

    Default [SOLVED]How to create jTextField autocompletion

    Hello guys, anyone know's how to create JTextField with automatic completion I need to use this to search for my customer data. I'm hoping that anybody could help me in this matter.
    Last edited by radix; 11-11-2008 at 08:55 AM. Reason: Problem solved

  2. #2
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default

    Just do a google search for this. I stumbled across it multiple times trying to figure out how to do a read only text field.

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

    Default

    I've remember that quite similar question discuss here in our forum. Search on hardwireds' posts. I think he posted such a similar post.

  4. #4
    radix is offline Member
    Join Date
    Nov 2008
    Posts
    10
    Rep Power
    0

    Default

    I searched on hardwired's posts unfortunately nothing found. :(

  5. #5
    radix is offline Member
    Join Date
    Nov 2008
    Posts
    10
    Rep Power
    0

    Default

    Hello guys I solved my problem I used "AutoCompleteDecorator" Class from SwingLabs. This class contains only static utility methods that can be used to set up automatic completion for some Swing components.

    Example:
    private void myInitComponent(){

    boxmodel = new DefaultComboBoxModel(getData());
    jComboBox1.setModel(boxmodel);

    autoCompleteDecorator1.decorate(jComboBox1);

    }

  6. #6
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    7

    Default

    There is someting called Ternary Search Tree that is effective here. 100% Java .
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

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

    Default

    Quote Originally Posted by radix View Post
    Hello guys I solved my problem I used "AutoCompleteDecorator" Class from SwingLabs. This class contains only static utility methods that can be used to set up automatic completion for some Swing components.
    Nice to see lol. It's better if you can post any link for SwinLabs specific page link you refer. It can be really helpful to others.

Similar Threads

  1. JtextField
    By kashifu in forum Advanced Java
    Replies: 2
    Last Post: 06-27-2008, 04:25 PM
  2. Constraining Input in JTextField
    By kataya in forum AWT / Swing
    Replies: 1
    Last Post: 06-26-2008, 06:25 PM
  3. how to focus to another JTextfield?
    By birdofprey in forum AWT / Swing
    Replies: 2
    Last Post: 04-09-2008, 01:08 PM
  4. Using Columns With JTextField
    By The Evil Genius in forum AWT / Swing
    Replies: 1
    Last Post: 03-17-2008, 01:01 AM
  5. help with JTextfield
    By gary in forum New To Java
    Replies: 4
    Last Post: 07-11-2007, 01:58 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
  •