?
Solved

Kill an applet, stop? destroy?

Posted on 1998-10-29
8
Medium Priority
?
1,143 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 600 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

764 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