Spades

Spades: Often you need to use a bunch of images for your applet. The best thing to do in this case is to create an array of images before your init method like this:

  Image sp[];

Next you need to specify the size of your array and populate your array in the init method like this:
    sp = new Image[13];
    for(int i=0; i<13; i++){
      sp[i]=getImage(getDocumentBase(), idCard(i));
    }

Since a special method was created to return the name of each card you will need to create an idCard method like this:
  public String idCard(int val){
    String out = "cards/";
    switch(val){
      case 0: out+="A"; break;
      case 1: out+="2"; break;
      case 2: out+="3"; break;
      case 3: out+="4"; break;
      case 4: out+="5"; break;
      case 5: out+="6"; break;
      case 6: out+="7"; break;
      case 7: out+="8"; break;
      case 8: out+="9"; break;
      case 9: out+="T"; break;
      case 10: out+="J"; break;
      case 11: out+="Q"; break;
      case 12: out+="K"; break;
    }
    out += "S.gif";
    return out;
  }

Finally, you can display your cards in the paint method like this:
    for(int x=0; x<13; x++) {
      g.drawImage(sp[x], 10+x*50, 50, this);
    }

Ofcourse, it's possible to not use the idCard method at all and just populate each array element one at a time like this:
   sp[0]=getImage(getDocumentBase(), "AS.gif");
   sp[1]=getImage(getDocumentBase(), "2S.gif");
   sp[2]=getImage(getDocumentBase(), "3S.gif");
   etc.

And you could do the same sort of thing with the drawImage method in the paint method, but you should be aware of the for-loop and the switch statement (although we won't go into how they work here).