Im trying to read the contents of a url from a Dialog box into a TextArea called field within my main menu, the Dialog box returns urlChoice i.e.
this is part of the code within my mainmenu
The next part is where the problems start
Using the example,
When this code is compiled it has one error saying,
cannot find symbol method openStream()
url.openStream()));
^
Any suggestions to output the url contents into field?
Cheers
Code:
public String getUrlInput()
{
return urlChoice;
}
Code:
private String url;
if (command.equals("connect"))
{
URLDialog window = new URLDialog(this, "URL dialog", true);
url = window.getUrlInput();
field.append("\nThe URL Selected is " + url); //Works fine to here
Using the example,
Code:
//URL url1 = new URL(url);
BufferedReader in = new BufferedReader(
new InputStreamReader(
url.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
cannot find symbol method openStream()
url.openStream()));
^
Any suggestions to output the url contents into field?
Cheers