Solved

Kill an applet, stop? destroy?

Posted on 1998-10-29
8
1,134 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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
 

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven project error 5 56
javap bin 2 35
HashTable highest marks enumeration alternative 9 39
printf performancy 11 43
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

810 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