Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2008
    Posts
    15
    Rep Power
    0

    Default Searching a String from Text file using Swings .

    hi friends .i am pradeep.i want a program to search using JButton in Swings.
    i have text file called u.txt and in that file code and description both fields are there .
    if i enter any word related to the fields of u.txt file and when i click the the button it should print the whole values about that word from that text file .
    so i am trying for it .but it is not correct .plz anybody help me .plz it is urgent .

    so i am waiting for solution.plz kindly help me .
    ok bye bye friends and developers

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    This is not really a Swing question. Or is it? You are not telling us what part is giving you difficulty: getting user input from the GUI (a Swing problem) or searching the textfile looking for a match (an IO and String problem).

    but it is not correct .
    This doesn't tell us much about what your problem is.

    plz anybody help me .plz it is urgent .
    This statement may have the opposite effect that you intend. I'd avoid using this sort of statement in the future.

    Good luck

  3. #3
    jurka is offline Member
    Join Date
    Jul 2008
    Posts
    67
    Rep Power
    0

    Default

    there is with nio API pattern search possibility, but also you can make simple i/o read line by line and then search from it String.

  4. #4
    khajalid is offline Member
    Join Date
    Sep 2008
    Posts
    31
    Rep Power
    0

    Default

    You should use separator for field name and its value and fetch line by line from file and separate that line into 2 strings using substring.One for field and one for its value.Then in the string of field for your keyword and print other string when maches.

  5. #5
    Join Date
    Jun 2008
    Posts
    15
    Rep Power
    0

    Default Setting Classpath for Struts


    hi friends .good morning .i want to run struts application manually.
    how to set the classpath for struts on my machine .
    so plz help me .
    any help should be appriciated .
    ok bye bye
    :D

Similar Threads

  1. count character in text file as input file
    By aNNuur in forum New To Java
    Replies: 7
    Last Post: 03-25-2010, 04:01 PM
  2. Searching XML file using DOM
    By simon in forum XML
    Replies: 5
    Last Post: 03-30-2009, 01:27 AM
  3. Searching a string from a text file using Swing Buttons
    By pradeep1_mca@yahoo.com in forum AWT / Swing
    Replies: 2
    Last Post: 09-15-2008, 09:50 AM
  4. How to read a text file from a Java Archive File
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-08-2008, 09:13 AM
  5. Replies: 1
    Last Post: 01-11-2008, 10:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •