0

Hello,

I am making a simple program that has you select Bible chapters and verses. I have all the chapters and verses in separate text files. I moved them into my source package. I am having trouble finding the code to put in the program so that java will open the files when needed.

-Thanks

5
Contributors
7
Replies
10
Views
6 Years
Discussion Span
Last Post by vadayattu
0

Are you looking at code to open the txt file and display the same or reading the file and processing

0

the below code will open the file extension with the default application in windows (txt > Notepad)

File dest = new File(filename);
Desktop.Action act;
act = Desktop.Action.OPEN;
Desktop desktop = Desktop.getDesktop();
desktop.open(dest);
0

This program works fine.But when i pass the filename from one jsp page(in that file already created) to next page where the code is for openning the text file on desktop, it shouldn't working.
<% String vtu=request.getParameter("f"); %>
Where f is the object of the type File

0

Reading a file from local and reading a file on a webpage are 2 different approaches. Also, you should create a new thread instead of revive an old thread...

0

addin a text is very simple. just follow this code
<<<<<<<File dest = new File(filename);
Desktop.Action act;
act = Desktop.Action.OPEN;
Desktop desktop = Desktop.getDesktop();
desktop.open(dest);>>>>>>>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.