Paul Greenstock

Greenhorn
+ Follow
since Sep 20, 2007
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 Paul Greenstock

Regina, this code works (but I dont like hardcoding the folder name)

public void getimages() {
String path = "file:////f:/towers/";
String fullpath="";
int z = 0;
String suffix=".gif";
String suits[] = { "h", "d", "s", "c" };
String cards[] = { "a", "2", "3", "4", "5", "6", "7", "8", "9", "t",
"j", "q", "k" };
try {
fullpath = path.concat("b"+suffix);
gifs[z] = getImage(new URL(fullpath));
fullpath = path.concat("j"+suffix);
gifs[53] = getImage(new URL(fullpath));
for (int x = 0; x < 4; x++) {
for (int y = 0; y < 13; y++) {
z++;
fullpath = path.concat(cards[y]).concat(suits[x]).concat(suffix);
gifs[z] = getImage(new URL(fullpath));
}
}
} catch (Exception MalformedURLexception) {
System.out.println("MalformedURLexception");
}
}
7 years ago
Yes. And this worked perfectly until the latest update. And I'm not using a Jar.
7 years ago
After the latest update the following code no longer retrieves my gifs. I did read that the latest update has changed codebase to return null. The question is how to fix this. I am not using a jar, I just have the class and gifs and html in the same folder. The applet paints the screen and just sits, no error messages on the console. Can I hard code the codebase in my applet ??


public void getimages() {
int z = 0;
String filename = "";
String suffix=".gif";
String suits[] = { "h", "d", "s", "c" };
String cards[] = { "a", "2", "3", "4", "5", "6", "7", "8", "9", "t",
"j", "q", "k" };
gifs[z] = getImage(this.getCodeBase(), "b" + suffix);
gifs[53] = getImage(this.getCodeBase(), "j" + suffix);
for (int x = 0; x < 4; x++) {
for (int y = 0; y < 13; y++) {
z++;
filename = cards[y].concat(suits[x]).concat(suffix);
gifs[z] = getImage(this.getCodeBase(), filename);
}
}
}
7 years ago
I have a game that listens for the 3 buttons on the mouse. However I have this smart new mouse that insists on defining the actions for each button. left and right are ok but I cant get the middle button through to my program. so my program never hears the middle/scroll button press. any ideas ??

paul
12 years ago