basically my GUI should ask user to input a file name then output a file name,
then look for a search word inside the (notepad) text file.
GUI
public class GUI
{
//string variables to store file names
String readFile,writeFile;
//method to encrypt the given file by adding 5
public void GUI(Scanner scan)
{
//reading input and output filenames
System.out.println("Enter Input file name");
readFile=scan.next();
System.out.println("Enter Output file name");
writeFile=scan.next();
try
{
//opening files
FileInputStream in=new FileInputStream(readFile);
FileOutputStream out=new FileOutputStream(writeFile);
//closing files
in.close();
out.close();
}
catch(Exception e)
{
//if any exception generates displays on console
System.out.println(e.toString());
}
}
public static void main(String[] args){
//user has to enter input file name;
Scanner scan = new Scanner(System.in);
System.out.println("Enter input file name");
System.out.println("Enter output file name");
}
}
after i need help with my other class that i attached
Read a input file and look for how many times a word happen
Copy the input file to the output file and putting word from input to output txt
Output # of words in input, the # of lines in input and the # of times the search word comes.
a word is a string of characters end with blank space.
This post has been edited by jon.kiparsky: 05 October 2012 - 10:34 AM

New Topic/Question
Reply



MultiQuote



|