• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

destroy()

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to destroy an applet?
Ich have programmed a clock that is counting down till 0. When it stopps counting (when hours, minutes and second are 0) I want the applet to disappear.
But I dont' know how to do so.
PLZ help!
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Franz,
You can't control an applets' life. The idea of an applet is that the browser controls its' life (i.e., when to create, when to destroy). That means whoever controls the browser (usually the user) controls the life of any applet.
If you want your own control, create a frame and then close it when you are done. In that way the user will just see an empty page when your applet has completed.
Regards,
Manfred.
 
Franz Meyer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Darn! ^^
Is it possible to usa a frame just the same like an applet? I mean is it working like a window or is it possible to implement a frame just like an applet?
 
Franz Meyer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe it is possible to hide the applet or to lay it in the background? This would be enough for my programming work!
 
Franz Meyer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, after a little thinking i decided to load another HTML-File.
But what I wnat to know is: How do I load another HTML-File in Applet?
I want to load this File only on my PC so I don't need that URL stuff. The two Files are stored on my Computer.
It would be possible to load the 2nd HTML-File in the 1st one, but I want to try loading it in the JAVA-File.
OK, I have written this Source
String theURLString = new String("myhtml.html");
try {
URL theURL = new URL(theURLString);
getAppletContext().showDocument(theURL, "_top");
}
catch(MalformedURLException e) {System.out.println(e);}
Problem is, that this Method searches the Internet for the Page. I want it to load it on my hard disc. But how to?
I tried with the hole pathname, but that doesn't work. Maybe someone knows!
THX for help.
[ February 28, 2002: Message edited by: Franz Meyer ]
 
Franz Meyer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey you guys, I really need help. Does anyone understand what I have written up there or is it too confusing to give a clear answer?
If I should describe the problem a bit more, you just have to say it.
I am sure that you guys know what to do about this problem!
So long and thanks for help!
 
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmm.
maybe you can try to create the URL relative to applet class file.
like this :
new URL(getCodeBase(),"/mypath/the htmlfile.html");
you can also use the getDocumentBase() to get the directory of the html file your applet is in(if the class and the html files are in different directories.)
 
Franz Meyer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This does work, I thank you, Roy!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic