Pracheth Gandrakota

Greenhorn
+ Follow
since Feb 13, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pracheth Gandrakota

Can anyone recommend a good textbook for java basics?
12 years ago
A drop down box thats says select language and submit and cancel buttons
12 years ago

Hey Guys, I have a bit of a problem,
I need a simple GUI for the following piece of code:


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;


public class wordsearch {
void wordsearchfunc(String fname,String gword)
{
try
{


String cword="",identi="",sample="";
int count = 0;
File f = new File(fname);
Scanner input = new Scanner(f);
while (input.hasNextLine())
{
sample=input.nextLine();
count++;
}
String line = "";
int lineNo;

FileReader fr = new FileReader(fname);
BufferedReader br = new BufferedReader(fr);
for (lineNo = 1; lineNo < count; lineNo++)
{
line = br.readLine();
if(gword.length()<line.length())
{
cword=line.substring(0,gword.length());
identi=line.substring(gword.length(),gword.length()+2);
if (cword.equals(gword)&& identi.equals("||"))
{
System.out.println("Word: "+gword+ "\nNomenclature: "+line.substring(gword.length()+2,line.length()));
}
}
}

}

catch(IOException e)
{
System.out.println(e);
}
}
public static void main(String args[])
{
if(args.length!=2)
{
System.out.println("Enter valid arguments");
System.exit(0);
}
else
{
String fname=args[0];
String gword=args[1];
wordsearch ws= new wordsearch();
ws.wordsearchfunc(fname,gword);
}
}
}
12 years ago