Results 1 to 5 of 5
- 08-29-2008, 12:30 PM #1
Member
- Join Date
- Jun 2008
- Posts
- 15
- Rep Power
- 0
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
-
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).
This doesn't tell us much about what your problem is.but it is not correct .
This statement may have the opposite effect that you intend. I'd avoid using this sort of statement in the future.plz anybody help me .plz it is urgent .
Good luck
- 08-29-2008, 08:45 PM #3
Member
- Join Date
- Jul 2008
- Posts
- 67
- Rep Power
- 0
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.
- 09-08-2008, 06:15 PM #4
Member
- Join Date
- Sep 2008
- Posts
- 31
- Rep Power
- 0
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.
- 09-09-2008, 05:29 AM #5
Member
- Join Date
- Jun 2008
- Posts
- 15
- Rep Power
- 0
Similar Threads
-
count character in text file as input file
By aNNuur in forum New To JavaReplies: 7Last Post: 03-25-2010, 04:01 PM -
Searching XML file using DOM
By simon in forum XMLReplies: 5Last Post: 03-30-2009, 01:27 AM -
Searching a string from a text file using Swing Buttons
By pradeep1_mca@yahoo.com in forum AWT / SwingReplies: 2Last Post: 09-15-2008, 09:50 AM -
How to read a text file from a Java Archive File
By Java Tip in forum Java TipReplies: 0Last Post: 02-08-2008, 09:13 AM -
Removing all the instances of a given text form a String
By Java Tip in forum Java TipReplies: 1Last Post: 01-11-2008, 10:06 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks