My students often have this problem with IE. The JVM in IE is based on Java 1.1. The
parseDouble method was added with Java 1.2 so it doesn't work with IE. I tell them to
go back to the old way using the intermediate step of creating a Double object from
the String object and then converting the Double object to a double. I've never seen
this happen with Netscape but it could be the same thing.
Dick Grant
Program Manager - Computer Programming
Seminole Community College
100 Weldon Blvd.
Sanford, FL 32773
407-328-2055
[EMAIL PROTECTED]
>>> [EMAIL PROTECTED] 07/08/02 10:02PM >>>
Did you try putting a try/catch block around it?
--- Michael Tang <[EMAIL PROTECTED]> wrote:
> Hi Experts,
>
> I have a snap shot of a simple code where I got a value from an entry
> from
> the user via the applet. Then parse it to double so that I can add +2.
> After that, I want to re-display at a text field. I did String.valueOf
> (strm_len).
>
> if (evt.getSource()== computeITX && choice1.getSelectedItem()=="6
> Strm" ) {
> String length_ans = textFieldUnitMtrs.getText();
> String output = "null";
>
> double strm_len = Double.parseDouble(length_ans);
> strm_len = strm_len + 2;
> output = String.valueOf(strm_len);
> textFieldUnitNum.setText(output);
> repaint();
>
> It works fine on my local machine (JBuilder) and also the appletviewer
> BUT
> when I load up to the server, it doesn't work. Can anyone comment on my
> code or where I went wrong? Both IE and Netscape have no response when I
> execute it. What are the options to parse/cast a double to String for a
> textfield display???
>
> Thanks in advance.
>
> Regards,
> Michael Tang
>
>
> To change your membership options, refer to:
> http://www.sys-con.com/java/list.cfm
=====
James Amos Nathaniel Stauffer
Stauffer_James
@yahoo.com
Spam food: [EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm