I have an old applet I created a few years back and it ran fine then. I tried it today and ended up with "incorrect value for width/height attribute". I then pulled a couple example applets of the web and end up with the same thing. Any suggestions?
Ok this is weird and I don't understand. I found an example of an applet that used width and height, called circle. My program is called Portrait. I copied my program into the circle program and took out all the circle code. The only thing I change was circle so it was the same file name. It worked. I can copy the circle program with my code to a new file and it works but I cannot copy my original Portrait code into a new file without getting the error.
Can anybody explain, that is, if I explained my issue well enough.
Thanks, Jim [ August 22, 2008: Message edited by: Jim Linebarger ]
What program gave the above message? It looks like its from a program, not the JVM. Is this an HTML problem? When you say you copied your program ..., do you mean the APPLET tag in HTML page? Or java source code?
Can you copy the contents of the java console here if that's where the error message comes from?
Joined: Dec 23, 2005
It's not in the HTML and I don't see how it could be in the java code for the applet either. Original program is Portrait. It worked last time I ran it (a few years ago). When I tried to run it I would get an error (will copy and paste below). I found an Applet online that works and draws a simple circle. I slowly started to copy and paste my source code into the Circle code while eliminating the Circle code. I did this until the code in both files are the same except I kept the Circle name for the file and class. Now the code in the Circle program runs correctly but the original that did a few years back does not.
HTML parsing: incorrect value for width/height attribute java.lang.NumberFormatException: for input String:"700," at java.lang.NumberFormatException.forInputString<NumberFormatException. java:48> at java.lang.Integer.parseInt<Integer.java:456> at java.lang.Integer.valueOf<Integer.java:553> at sun.applet.AppletViewerPanel.getWidth<AppletViewerPanel.java:116> at sun.applet.AppletPanel.init<AppletPanel.java:192> at sun.applet.AppletViewer.<init><AppletViewer.java:177> at sun.applet.StdAppletViewerFactory.createAppletViewer<AppletViewer.ja va:82> at sun.applet.AppletViewer.parse<AppletViewer.java:1122> at sun.applet.AppletViewer.parse<AppletViewer.java:1056> at sun.applet.Main.run<Main.java:138> at sun.applet.Main.main<Main.java:80> [ August 22, 2008: Message edited by: Jim Linebarger ]
Originally posted by Jim Linebarger: It's not in the HTML
I don't see how you can say that given what the error message says:
HTML parsing: incorrect value for width/height attribute java.lang.NumberFormatException: for input String:"700,"
I predict that if you have a look at the HTML you asked the applet viewer to display, you will find it has an attribute named "width" or "height" which has a value starting with "700,". Get rid of the comma. And anything that might be after it.