Results 21 to 24 of 24
Thread: Search within a JList
- 03-24-2011, 12:28 PM #21
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
- 03-24-2011, 12:38 PM #22
Member
- Join Date
- Mar 2011
- Posts
- 15
- Rep Power
- 0
Right, I did think I would have problems with that line of code. So then, how do I apply the list.getNextMatch(..) to setSelectedIndex()? I want it to set the selected index when the user types a matching search and presses the search button. I just can't seem to figure this out.
- 03-24-2011, 12:46 PM #23
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
getNextMatch() returns an int.
That in can either be assigned to a variable:
or, it can be passed straight into another method call as a parameter:Java Code:int someInt = list.getNextmatch(...);
...Java Code:someOtherMethod(list.getNextMatch(...));
- 03-24-2011, 12:51 PM #24
Member
- Join Date
- Mar 2011
- Posts
- 15
- Rep Power
- 0
Similar Threads
-
Link one JList to another JList
By mib1bee in forum AWT / SwingReplies: 1Last Post: 12-31-2010, 07:10 PM -
Link one JList to another JList
By mib1bee in forum New To JavaReplies: 1Last Post: 12-30-2010, 06:24 PM -
Not able to highlight the search key work in wild card search
By annappa in forum LuceneReplies: 0Last Post: 10-29-2009, 09:28 AM -
How could I search elements in a Jlist?Please Help!
By Pro Alinio in forum New To JavaReplies: 4Last Post: 03-25-2009, 11:49 PM -
make search function ike eclipse search in window->preference
By i4ba1 in forum Advanced JavaReplies: 5Last Post: 08-26-2008, 03:43 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks