tengo el siguiente codigo
Código
package TileMap; import java.awt.Color; import java.awt.Graphics2D; import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; import java.io.File; import javax.imageio.ImageIO; import javax.swing.JPanel; int [][]map1 = new int[][]{ {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,2,2,0,0,1,1,1,1,1,0,0,0,0,0,0}, {0,0,0,0,0,2,2,0,0,1,1,1,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1}, {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, }; super.paint(g); for(int row =0; row < 20; row++){ for(int col=0; col< 15; col++) { int rc = map1[row][col]; if(rc == 0){ } if(rc == 1 ){ } if(rc == 2 ){ } g2d.fillRect(1+col*33,1+row*33, 33, 33); } } } }
el compila bien y corre bien cuando depuro pero cuando hago el jar me sale en negro la pantalla , alguien me podria ayudar por favor ?
Mod: Tema modificado, recuerda usar etiquetas GeSHi