|
-
Jun 22nd, 2006, 02:10 PM
#1
Thread Starter
Junior Member
i need help in file
i creat Jcombo box that contain names of file
and i make the following step to put the user select to astring
String h=jb1.getSelectedItem().toString();
and according to string h which is the name of file i want this file to be write
file f=new file(h)
FileReader fr = null ;
BufferedReader br = null;
BufferedWriter bw= null;
try
{
fr = new FileReader(in);
br = new BufferedReader(fr);
while ((thisLine = br.readLine()) != null)
{
System.out.println(thisLine);
//out.close();
}
}
catch (Exception l)
{
System.out.print("error");
}
}
but when i run that it tell me that it can not find the file
i fell that because i pass string h not (Ex."in.txt) how i can solve that
note i can pass the name of file direct
help me please
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|