Solved

Kill an applet, stop? destroy?

Posted on 1998-10-29
8
1,133 Views
Last Modified: 2008-03-04
I have an applet. It works fine. you run the
applet, go to some other page, come back and run
the applet again, and it dosn't work properly.
If you do a shift/reload, the applet will work again
like it is suppose to.  Do I need to "destroy" it when
the user clicks the "done" button so that it will be
fresh next time it is ran?  Use the "stop" function?
If so, would anybody have a small piece of code showing
me how to do this?

Thanx

don
0
Comment
Question by:afsac
  • 5
  • 2
8 Comments
 
LVL 4

Expert Comment

by:rembo
ID: 1226663

You need to override the start()
method.  

When you go to another page, the stop() method is called.
When you come back, the start() method is called.  

Whatever stuff you are doing to start the applet in
init(), you should move to another method and then
call it again from the start() method.  

If you need a little more explanation or a little code
snippet, let me know.


Hope that helps,

-Tony

0
 

Author Comment

by:afsac
ID: 1226664
Yes please, a snippet of code would be greatly appreciated.
Thank you for answer my question.  If you can give me an
example, I'll see if I can get it to work.

thanx

don
0
 

Author Comment

by:afsac
ID: 1226665
Would anybody else have a piece of code to show
me how to impliment rembo's suggestion?
0
 

Author Comment

by:afsac
ID: 1226666
I really need help on this.  I've messed with init(), start(), stop(), detstroy()
and nothing seems to work.  I need this applet (frame) to die so that when
I come back into it, it starts fresh like a SHIFT RELOAD does.

I've raised the points to 200, I don't have much left but I sure could use
and answer on this....any takeres?

Don
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:fugitive_2
ID: 1226667
do you still need answers afsac??
0
 

Author Comment

by:afsac
ID: 1226668
YES! PLEASE, any help would be greatly appreciated.

Thanx

Don
0
 

Accepted Solution

by:
fugitive_2 earned 200 total points
ID: 1226669
declare your applet to implement Runnable.
create a Thread for the applet, at the beginning of the applet class.
initialize that thread in the applets start() function, Thread x = new Thread(this);
using the function Thread.start(), start the thread in the applets start().
in applets stop() function, declare Thread.stop(), and Thread = null
in applets destroy() function, declare Thread.stop() and Thread = null.
This will cause the applet to to call the Threads run function at the applets start() function.
override the Threads run function, this function is what is called at Thread.start();
public void run()  {
} // End run.
in run is where the computing of the applet is put.  
build a simple applet with this idea and see how it works, then implement bigger applets.
let me know if you have any questions.
fugitive_2
0
 

Author Comment

by:afsac
ID: 1226670
i'll work with it when I get a chance.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now