Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help 2

0 views
Skip to first unread message

Tim McGuire

unread,
Nov 24, 1996, 3:00:00 AM11/24/96
to

OK, I rewrote the VHS applet that I was asking about earlier and made it
much, much simpler. There's still a problem, but now it's a different
error message. Here's what happens when I run AppletViewer:

java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
at java.util.Vector.elementAt(Vector.java:245)
at Animation.run(Animation.java:38)
at java.lang.Thread.run(Thread.java:294)

with the following HTML:

<applet code="Animation.class" width="100" height="100">
<param name="image0" value="3.gif">
<param name="image1" value="2.gif">
<param name="image2" value="1.gif">
<param name="image3" value="0.gif">
<param name="delay" value="1000">
</applet>

As you can see, I'm not a pro when it comes to analyzing Java's cryptic
error messages.

You can view the applet's code at
http://www.superior.net/~tmcguire/Animation.java

Check it out, and if you can help me, please do so ASAP!

\^^^^^^^^/
(.) (.)
--------------------------.oooO-- (__) --Oooo.----------------------------
N Y Y A N K E E S - - C H A M P I O N S
! ________ /`|`\ +------------------------------------+
! _....._/|__|____\..___../ | | | Tim McGuire |
<|~oooo _____ c===-|---+ tmcg...@superior.net |
!\...___/~~~~~\_____..___---.|,/ | http://www.superior.net/~tmcguire/ |
! / |~~|__..-` 0 +------------------------------------+
< | "I believe it's time for me to fly..."
(o) -REO Speedwagon


David Lacey

unread,
Nov 24, 1996, 3:00:00 AM11/24/96
to

You should be looping on while getParameter not null, not on the
uninitialised images vector. You should only loop on a vector up to to it's
length, which I think is images.elementCount. The out of bounds error is
because you are trying to access an element of a vector that is not there.

Tim McGuire <tmcg...@superior.net> wrote in article

>
> java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
> at java.util.Vector.elementAt(Vector.java:245)
> at Animation.run(Animation.java:38)
> at java.lang.Thread.run(Thread.java:294)
>

David Lacey

unread,
Nov 24, 1996, 3:00:00 AM11/24/96
to

This is a programming error, and should not be referred to advocacy, misc
or security.

The problem is an uninitialised vector, by the way, as explained in
previous reply

Greg Turner

unread,
Dec 1, 1996, 3:00:00 AM12/1/96
to Tim McGuire

Tim McGuire wrote:
>
> OK, I rewrote the VHS applet that I was asking about earlier and made it
> much, much simpler. There's still a problem, but now it's a different
> error message. Here's what happens when I run AppletViewer:
>
> java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
> at java.util.Vector.elementAt(Vector.java:245)
> at Animation.run(Animation.java:38)
> at java.lang.Thread.run(Thread.java:294)
>
> with the following HTML:
>
> <applet code="Animation.class" width="100" height="100">
> <param name="image0" value="3.gif">
> <param name="image1" value="2.gif">
> <param name="image2" value="1.gif">
> <param name="image3" value="0.gif">
> <param name="delay" value="1000">
> </applet>
>
> As you can see, I'm not a pro when it comes to analyzing Java's cryptic
> error messages.
>
> You can view the applet's code at
> http://www.superior.net/~tmcguire/Animation.java
>
> Check it out, and if you can help me, please do so ASAP!

Whenever I have done applets, I have written the html like this:
Notice the difference in where the quote marks are:
<applet code="Animation.class" width=100 height=100>
<param name=image0 value="3.gif">
<param name=image1 value="2.gif">
<param name=image2 value="1.gif">
<param name=image3 value="0.gif">
<param name=delay value="1000">
</applet>

Second, the error message here is actually quite helpful
since it gives you line numbers in source which for me
is usually enough to spot the error. Since my browser does not
have a goto line number function, I will not take the time
to count it out; you can do this. It is line #38 in your
code. If that is not enough, then just look further at
line 245 in Vector.java.


--
Greg Turner, Intelligent Software
Box 1506 gtu...@hooked.net
Mill Valley, CA 94942 http://www.hooked.net/~gturner/

0 new messages