Skip to main content

TumbleItem.java

1 reply [Last post]
ldo
Offline
Joined: 2009-11-25
Points: 0

Hello All,

there is maybe a failure in this code:

http://java.sun.com/docs/books/tutorial/uiswing/examples/components/Tumb...

***codesnip
protected void loadAppletParameters() {
//Get the applet parameters.
String at = getParameter("img");
dir = (at != null) ? at : "./images";

codesnip***

shouldn't it be:
String at = getParameter("dir");

If I change this the Applet will run, could you please let me know if the code is wrong or I have thought something wrong,

thanks a lot

cheers
ldo

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nikopp
Offline
Joined: 2010-01-07
Points: 0

Hi ldo,

in my opinion, the original code is correct since "img" ist the name of the parameter as described in the method "getParameterInfo()":


{"img", "string", "the directory containing the images to loop"},

I think the fact that all the other variables are named exactly like the the parameters might have confused you.

Regards, Niko