to declare and populate my array i am using

//declare 
	Image pictures[][] = new Image[16][14];

public void init(){
		//populate
		pictures[2][0] = getImage(getCodeBase(),"twohearths.png");
		pictures[3][0] = getImage(getCodeBase(),"threehearths.png");
		pictures[4][0] = getImage(getCodeBase(),"fourhearths.png");
		pictures[5][0] = getImage(getCodeBase(),"fivehearths.png");
		pictures[6][0] = getImage(getCodeBase(),"sixhearths.png");
		pictures[7][0] = getImage(getCodeBase(),"sevenhearths.png");
		pictures[8][0] = getImage(getCodeBase(),"eighthearths.png");
		pictures[9][0] = getImage(getCodeBase(),"ninehearths.png");
		pictures[10][0] = getImage(getCodeBase(),"tenhearths.png");
		pictures[11][0] = getImage(getCodeBase(),"jackhearths.png");
		pictures[12][0] = getImage(getCodeBase(),"queenhearths.png");
		pictures[13][0] = getImage(getCodeBase(),"kinghearths.png");
		pictures[14][0] = getImage(getCodeBase(),"acehearths.png");
		
		pictures[2][1] = getImage(getCodeBase(),"twodiamonds.png");
		pictures[3][1] = getImage(getCodeBase(),"threediamonds.png");
		pictures[4][1] = getImage(getCodeBase(),"fourdiamonds.png");
		pictures[5][1] = getImage(getCodeBase(),"fivediamonds.png");
		pictures[6][1] = getImage(getCodeBase(),"sixdiamonds.png");
		pictures[7][1] = getImage(getCodeBase(),"sevendiamonds.png");
		pictures[8][1] = getImage(getCodeBase(),"eightdiamonds.png");
		pictures[9][1] = getImage(getCodeBase(),"ninediamonds.png");
		pictures[10][1] = getImage(getCodeBase(),"tendiamonds.png");
		pictures[11][1] = getImage(getCodeBase(),"queendiamonds.png");
		pictures[12][1] = getImage(getCodeBase(),"jackdiamonds.png");
		pictures[13][1] = getImage(getCodeBase(),"kingdiamonds.png");
		pictures[14][1] = getImage(getCodeBase(),"acediamonds.png");
		
		pictures[2][2] = getImage(getCodeBase(),"twoclubs.png");
		pictures[3][2] = getImage(getCodeBase(),"threeclubs.png");
		pictures[4][2] = getImage(getCodeBase(),"fourclubs.png");
		pictures[5][2] = getImage(getCodeBase(),"fiveclubs.png");
		pictures[6][2] = getImage(getCodeBase(),"sixclubs.png");
		pictures[7][2] = getImage(getCodeBase(),"sevenclubs.png");
		pictures[8][2] = getImage(getCodeBase(),"eightclubs.png");
		pictures[9][2] = getImage(getCodeBase(),"nineclubs.png");
		pictures[10][2] = getImage(getCodeBase(),"tenclubs.png");
		pictures[11][2] = getImage(getCodeBase(),"queenclubs.png");
		pictures[12][2] = getImage(getCodeBase(),"jackclubs.png");
		pictures[13][2] = getImage(getCodeBase(),"kingclubs.png");
		pictures[14][2] = getImage(getCodeBase(),"aceclubs.png");

		pictures[2][3] = getImage(getCodeBase(),"twospades.png");
		pictures[3][3] = getImage(getCodeBase(),"threespades.png");
		pictures[4][3] = getImage(getCodeBase(),"fourspades.png");
		pictures[5][3] = getImage(getCodeBase(),"fivespades.png");
		pictures[6][3] = getImage(getCodeBase(),"sixspades.png");
		pictures[7][3] = getImage(getCodeBase(),"sevenspades.png");
		pictures[8][3] = getImage(getCodeBase(),"eightspades.png");
		pictures[9][3] = getImage(getCodeBase(),"ninespades.png");
		pictures[10][3] = getImage(getCodeBase(),"tenspades.png");
		pictures[11][3] = getImage(getCodeBase(),"queenspades.png");
		pictures[12][3] = getImage(getCodeBase(),"jackspades.png");
		pictures[13][3] = getImage(getCodeBase(),"kingspades.png");
		pictures[14][3] = getImage(getCodeBase(),"acespades.png");

I have been trying to figure out how to remove elements from the array when the picture is drawn, as to simulate there being only 52 cards. Any ideas?

pictures[i][j] = null;
pictures[i][j] = null;

how does that work do i add it before i declare my array or what?

how does that work do i add it before i declare my array or what?

when you want to remove the element from array

how does that work do i add it before i declare my array or what?

when you want to remove the element from array

ahh, i understand it now thanks for the reply

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.