How I am supposed to open a text file using URL? I tried converting URL to string, which would fit the format for creating a file from string, but doesn't seem to be working well. It is untill I export my project.
Do you understand the difference between a URL
, a String and a text file? I have no idea what you are trying to do. Some suggestions:
- if you want to read the source indicated by the URL into a String (e.g. a webpage into a String), look here
- if you want to convert the URL to its String representation, simply do
String address = url.toString();
This is what you appear to be doing. The result is the URL address in plain text (e.g. "http://www.java-gaming.org