Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #4847

Re: JComboBox with search in database?

From markspace <-@.>
Newsgroups comp.lang.java.gui
Subject Re: JComboBox with search in database?
Date 2011-12-18 19:59 -0800
Organization A noiseless patient Spider
Message-ID <jcmcrk$3vp$1@dont-email.me> (permalink)
References <639f3aa1-9aff-4275-9457-1d997e19768c@o9g2000yqa.googlegroups.com>

Show all headers | View raw


On 12/18/2011 9:21 AM, The Nigga wrote:
>
> JCombobox is setEditable(true) for searching in my database.


> How to make a search with JComboBox with enter one by one word ?


I'm having some trouble envisioning what you are trying to accomplish.

Normally, I think of "search string" as just a string with some 
different words, which I then parse.  JComboBox seems the opposite of 
this concept.  Why use a JComboBox for search?  That seems to be the 
most likely error here, using an inappropriate Swing component.

Second, what do you mean by "one by one word."  That phrase really isn't 
semantic in English.  Do you mean "one word at a time?"

For searching, you don't.  You let the user enter enter their big search 
string, then you parse it, probably breaking it up into words (or 
"tokens") as you go.

   String exampleSearch = "This is an example search string.";

   // break the above into 6 "words"

   String[] tokens = exampleSearch.split( " " );

So there's some questions and some example code for you.

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

JComboBox with search in database? The Nigga <fernandopaivabr@gmail.com> - 2011-12-18 09:21 -0800
  Re: JComboBox with search in database? markspace <-@.> - 2011-12-18 19:59 -0800
  Re: JComboBox with search in database? "John B. Matthews" <nospam@nospam.invalid> - 2011-12-19 02:36 -0500
    Re: JComboBox with search in database? The Nigga <fernandopaivabr@gmail.com> - 2011-12-19 07:12 -0800
      Re: JComboBox with search in database? The Nigga <fernandopaivabr@gmail.com> - 2011-12-23 15:34 -0800

csiph-web