File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Warning: Thread.suspend() was called; Navigator deadlock might result Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "Warning: Thread.suspend() was called; Navigator deadlock might result" Watch "Warning: Thread.suspend() was called; Navigator deadlock might result" New topic
Author

Warning: Thread.suspend() was called; Navigator deadlock might result

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 3901
I have a page with some applets on it. In Netscape I get this error when I leave the page.
Warning: Thread.suspend() was called; Navigator deadlock might result
Why? Then when I close the window I get an windows warning that Netscape committed an illegal act.
OK one of the applets starts a thread that scrolls some text. I suspend that thread in stop() not the thread running the applet.
public void stop() {
if (runner.isAlive())
runner.suspend();
}
Netscape does freeze trying to load a different applet from another page about half the time.
[This message has been edited by Randall Twede (edited February 21, 2001).]


I never took notes in college. That's how I got a 4.0 the first 2 years, and a 3.5 the second two years.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4120

Randall,
Thread.suspend() is deprecated... something like this may work better :

This code should work fine in the majority of cases... however, if your Thread actually contains info that will be important in the Applet even if it is 'switched off', you will probably need to do something with nested loops...
HTH,
-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 3901
Nathan,
I think that would work ok. It was my first applet and a tutorial showed me to do it that way
I need to change the background color of the applet anyway since Netscape has a default of white(same as the page it is on). It is all jarred up and I am lazy though.
 
 
subject: Warning: Thread.suspend() was called; Navigator deadlock might result
 
Threads others viewed
Applet not starting
Aplet not Starting help needed
Deprecating?
Displaying a JOptionPane in the stop method?
suspend and resume method - Thread
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture