Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.gui Subject: Re: JComboBox with search in database? Date: Sun, 18 Dec 2011 19:59:46 -0800 Organization: A noiseless patient Spider Lines: 30 Message-ID: References: <639f3aa1-9aff-4275-9457-1d997e19768c@o9g2000yqa.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 19 Dec 2011 03:59:48 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="4089"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Zuj8iYa4eZPemAwVoDxdBboKiuoPParQ=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <639f3aa1-9aff-4275-9457-1d997e19768c@o9g2000yqa.googlegroups.com> Cancel-Lock: sha1:73LoMzZ7PPc15sto06T6r5lgJIQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4847 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.