Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create a drop down list below the text field after receiving the key event ?

 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i want to make using swing is suppose i have a textfield and user always enters a ip address for eg :127.0.0.1 so each time user start entering the ip address like 127 my textfield should show a drop down list below the textfield which will show all the ip address starting with 127
what are the options to make such a thing ..i have initiated the process with JList but it didnt help
can any one help me ?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
asked and answered 1000's of times - google 'autocomplete' + other appropriate keywords
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn wrote:asked and answered 1000's of times - google 'autocomplete' + other appropriate keywords


thanks but the code which they are showing is a bit difficult to understand ....do you have any code that is simple straight ?
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any class JSuggestionField which can help me make a autocomplete field
if not than what is the another way of doing this with the jtextfield i m sure you guyz out there have many alternatives
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> thanks but the code which they are showing is a bit difficult to understand

there are ready-to-go .jars out there, no need to understand how they work (although at times it is handy)
 
Rob Camick
Ranch Hand
Posts: 2542
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks but the code which they are showing is a bit difficult to understand


Do you think people write complex code for the fun of it?

do you have any code that is simple straight ?


What makes you think the code for this requirement is simple and straight?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic