Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaying numbers in an applet

 
Sam Tilley
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i am trying to write a program where i take in a few numbers in a textfield, convert them to a double do some calculations on them and then print them out to a label. The program works well and as i am doing it in Forte when i execute the program the applet starts up and works fine.
However if i try and copy the classes to a file on a network and open up the applet on another pc the applet opens up but when i press my calculate button nothing comes up at all. For some reason in the webpage it will not display text for some reason.
Does anyone know why this is and how i can get around it ???
I have enclosed the applet (apologies for it being a bit long)
 
David G Risner
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
However if i try and copy the classes to a file on a network and open up the applet on another pc the applet opens up but when i press my calculate button nothing comes up at all. For some reason in the webpage it will not display text for some reason.

I assume that this PC is running IE using MS's Java VM. This VM is only compatible up to 1.1.4. Double.parseDouble was added later than 1.1, I think it was added in 1.2, but it might have been 1.3.
Change your Double.parseDouble() calls to something like Double.valueOf().doubleValue()
You might also need to compile using the "-target 1.1" option in Javac if you are using 1.3 or 1.4.
 
Sam Tilley
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent that works a treat, thanks David
 
mark stone
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the java VM that comes with the IE, which version of IE ? is the vm version same for IE 5.x and 6.x ?
how to find this info ? i did some digging in the microsoft web site but just cannot get this info.

Originally posted by David G Risner:

I assume that this PC is running IE using MS's Java VM. This VM is only compatible up to 1.1.4. Double.parseDouble was added later than 1.1, I think it was added in 1.2, but it might have been 1.3.
Change your Double.parseDouble() calls to something like Double.valueOf().doubleValue()
You might also need to compile using the "-target 1.1" option in Javac if you are using 1.3 or 1.4.
 
Marilyn de Queiroz
Sheriff
Posts: 9068
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.coderanch.com/t/369611/java/java/browser-doesn-display-applets
http://www.coderanch.com/t/254541/Applets/java/Game-Tutorials-Exploring-Browser-Support

Try this with your browser after you read the above links.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic