Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

problem with timer object in applet

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
tyler jones
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 am displeased. You are no longer allowed to read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic