• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

need help in searchin

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to saerchin and was wondering what could i do to get familiar with it...in scjd what is it expected...normal checkin of databases or using regular expressions to get results......

please advice
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well you could use regular expressions, if you are just using JTextFields in your search lookup. However, you will want to use JComboBoxes instead. Actually, that is kind of wrong, in that you can still use regular expressions , but in most cases the values in the JComboBox will be all the full values possible, and so you wouldn't need the regular expressions since you will have the whole string anyway.



Mark
 
Abhi Chat
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx Mark...

Would you able to provide me an example code snippet of a regular expression which can do searchin from textfields

Assuming the file is:

ID NAME LOCATION PRICE DATEOF ISSUe

now if i type in a name = "Fre"....i want all the names and their correspondin values begining with "FRE"

or suppose location = " LA"... or vice versa...
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Look at the Pattern class in the Java 1.4 API.

To find out if String myString begins with "Fre", you could do:
 
Jared Chapman
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark,

As of now I am using JTextFields. Just wondering what your reasoning is for using JComboBoxes is instead. I know they are a lot more convenient for the user, but as far as this assignment is concerned, aren't JTextFields good enough?
 
Jared Chapman
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, and I almost forgot - congrats on #6000, Mark!
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, actually I feel it is much easier to code that way. I believe that there are points regarding GUI and user interface, and providing a nice GUI for the operators that make it easier to use would get more points.

Abhi, actually AI don't use regular expressions, and never memorized the patterns for them and the two classes and methods that are used to run a regular expression on a String. Sorry.

Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic