aspose file tools
The moose likes Applets and the fly likes problem with timer object in applet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "problem with timer object in applet" Watch "problem with timer object in applet" New topic
Author

problem with timer object in applet

tyler jones
Ranch Hand

Joined: Dec 01, 2000
Posts: 101
I have written an applet that uses a timer object and timertask object. What I didn't realize right away was that these classes aren't included in java 1.1, so I guess my applet won't work for most people? Am I correct or is there a way to make it work for people still. Is this 1.3 and 1.4 plugin supposed to give the browser the ability to run newer versions of java code? And if so, how do I make my applet use that plugin then to execute? Thanks.
PS. If trying to make this work is too complicated, is there another way to accomplish a timertask and timer routine via threads without getting too messy?
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
One thing you may wish to try is compiling with the target switch:
javac -target 1.1 Whatever.java
The class file(s) will no doubt be a bit larger, but it should run on any 1.1 or newer JVM version.
The documentation for javac can be found at http://java.sun.com/j2se/1.4/docs/tooldocs/windows/javac.html
If you try this, I'd be curious if it works (it should) and how much larger the class files become.
Good Luck.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
tyler jones
Ranch Hand

Joined: Dec 01, 2000
Posts: 101
Thanks, but unfortunately, that didn't work. It's still looking for the timer class, so it's not going to be compatible with 1.1.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Oh well, it was worth a try. If I were you, and the Timer and TimerTask classes were potentially the only non-Java 1.1 features I wanted to use in my applet, then I'd write my own Timer class so that I weren't bothering my users/customers to have to download and install some plug-in.
If you did want to go the plug-in route, then take a look at Sun's Plug-In Page:
http://java.sun.com/getjava/download.html
and this article by Mark Andrews on the plug-in:
http://www.tornadolabs.com/News/Java_Plugin/java_plugin.html
and hopefully you'll get an idea of what you need to do.
[ June 04, 2002: Message edited by: Dirk Schreckmann ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with timer object in applet
 
Similar Threads
How to stop a Timer after it's run more than once?
How to avoid IllegalStateExceotion in Timer
Timer
what is the best way to run a schedule??
Timer & TimerTask - Name of Timer Object