Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

Thomas Sweetman

Greenhorn
+ Follow
since Sep 27, 2012
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 Thomas Sweetman

there arnt any, thats whats confuseing me... ive tried putting in a trace with System.out.println but it dosent show up, it may just be a HTML issue now rather than java...
5 years ago
okay ive merged everything now, and using getImage but im still getting just a blank screen, is this because it cannot find it??

Code:
5 years ago
okay you cant actually read that so ill type it out

root:-
wpimages:-
(my images are in here)
wpiscripts
(nothing)
Game.class
gameLoop.class
index.html
5 years ago
okay no error anymore console comes up normally and no exception errors, however nothing shows up on screen? is just white space?? ill send the new code and a screen print of the file managing

gameLoop:-
Code:
5 years ago

im using serif web designer to test it out given i havent as of yet purchased a domain and hosting services, this wont affect it will it? even so it still comes up with the same error, ive put it in the file thats their im hoping that would work
5 years ago
okay can you show me how to use the getImage function properly then? because what ive guessed at hasent worked thank you for the quick reply
5 years ago
i have an issue with my java applet ive been developing, everything is fine and working wonderfully in the IDE (eclipse) however once i take the class files out and put the two of them in the same folder with all the images and use a HTML file to run it it opens then the java console comes up and has this exception:-

Exception in thread "Thread-12" java.security.AccessControlException: access denied ("java.io.FilePermission" "Background.png" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.canRead(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
at gameLoop.run(gameLoop.java:27)
at java.lang.Thread.run(Unknown Source)
ive looked everywhere and i dont know what to do my sorce code is below

game:
Code:

gameLoop
Code:

my HTML file:-
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>The Adventures Of Marmalade</title>
<style type="text/css">
body { color: white; background: black }
</style>
</head>
<body>
<div>
<h1 align="center">The Adventures Of Marmalade</h1>
<applet code=Game.class width=854 height=480>


Sorry, you need a Java-enabled browser to run this applet.


</applet>
</div>
</body>
</html>



i would attach the images but there are alot of them, im sure there is just something ive missed or i have gone the wrong way about something, if anyone has an answer please help thank you
5 years ago