Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

A Parent

Greenhorn
+ Follow
since May 18, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by A Parent

huh. I had a reply here, and now it's gone.

anyway, I'm still working on making the code change you suggested--but am not sure if that would effect the cache issue?

btw, this is no longer a "school project" but is now on my own time and curiosity.
17 years ago
wow, that does seem much simpler. ::scampers off to edit code::

do you think that would solve my cache issue?
17 years ago
thanks craig... the first hint helped a lot, and now the applet will run on the web. However, now I'm seeing other errors. The first time the game is played, all is well,... but the second time, when a match is found, it's resetting to the values the cards had in the first game.

So I'm guessing my reset method needs some kind of clear cache? I searched for a clear cache method but didn't find anything.

We didn't go over jar files in class at all, so I'm unfamiliar with them... and not sure how you mean that I only need to load the images once? There are more images than the game needs, so each time the game is played it needs to load the ones it wants that time?
17 years ago
those sound like truly horrible courses. Feel much better about my own experience now!

I clutched my Savitch book this whole year, it was a pretty good resource, but occasionally did not go into as much detail as the prof.
17 years ago
here is the relevant code I added, and I changed all references to folder1/folder2 to be the URLS.

17 years ago
Thanks for responding!

I thougth I didn't need to use URLs, since the relative links are the same, they are in the same directory on server. (If this were html, it would have no difficulty accessing the images). Also, if I attempt to run this locally (off a browser, just dragging the html file to the browser) it doesn't render either, and that is local, and relative.

researching further tho, thanks for the lead.

[edit]

ok, I searched on URLs, searched on getDocumentURL, and hulkSmashed some code together, which still doesn't work. I am testing this locally from my hard drive, but as an applet in aHTML. It compiles, but displays this error onscreen:

Java Security AccesControlException: AccessDenied (java io FilePermission incredi/backgroundWin.jpg read) which is the first image that is attempted to access.
[ May 20, 2005: Message edited by: A Parent ]
17 years ago
I have a small game of memory cards which I got working properly, but I want to put on the web. I followed the basic guidelines, changed the constructor to init(), removed SetSize and SetTitles, removed references to closeWindow or system.exit(0), and thought that should be enough, but it does not work. After uploading to the server, it will not load and appears to give an access denied/file permission IIO error. (http://homepage.mac.com/aparentdesign/design/code.html)

All class files are in thee same directory as the HTML. I am worried it is not accessing the images in their folders, even though they also are in the same directory as the HTML and the relative link path should be the same no matter where it is. I am able to view the graphics as a URL, so I don't think it's .mac preventing access to the images. (http://homepage.mac.com/aparentdesign/design/random/0.jpg )

My other thought is that it does not like the timer method I used to pause the game?

Is there anything else that JApplets don't like? I've been searching Sun's tutorials and haven't found anything that seems to address this.

Since I don't know where exactly the problem may lie, I'm gonna have to paste the whole thing... sorry!
17 years ago
thank you! Can't tell you how long I looked at thread samples but wasn't sure how to integrate them into my own code. I also found the Timer method, which worked too.



Now it's not working as I try to convert to an applet, I have changed the constructor to init, removed the setSize, setTitle calls... it's saying there's a Java IO access Permission error? I'll do a little more research and then post a new thread in applets.
[ May 20, 2005: Message edited by: A Parent ]
17 years ago
I have a simple memory game that I've been trying to debug. It allows the user to flip two cards, compares them, if they are a match they stay up, otherwise get flipped back over. Problem is, for the second card flipped, it next does the comparison so quickly, it doesn't seem that the second card was ever displayed.

Any ideas on how to fix this, or is there something I'm missing? I spent most of the day on sun's website trying to figure out threads and sleep vs wait... you can tell I'm not an expert. TIA!

17 years ago