Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

java.net.URL ?

  Asked By: Boell    Date: May 05    Category: Java    Views: 927
  

i cant seem to load a new URL document from an existing applet
below is the snapshot of the java code

First, i open the "Registration.html" which loads the
Registration.class
OK, it works, then i have a JButton on that class with an
actionListener... the statement inside the actionPerformed method is
suppose to call a new URL...
i have the "LoadImage.html" on the same path where the
Registration.class is located together with the HTML files...

try
{
getAppletContext().showDocument(new URL("LoadImage.html"));
}
catch(MalformedURLException eURL)
{
getAppletContext().showStatus("URL Error");
}


when i click on the Button the Exception message is displayed
why????? please help...

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Amelia Schmidt     Answered On: May 05

Try loading the url  as follows

new URL("http://mysite/LoadImage.html")

 
Didn't find what you were looking for? Find more on java.net.URL ? Or get search suggestion and latest updates.




Tagged: