drawing images in a JPanel
Hello to all,
I've been trying to draw more than 1 image in the same JPanel using a Graphics2D object and its drawImage() method. My idea is to fill my JPanel of a grid of 50x50 px images. My project is a 2D game, so the grid would be the sprites of the maps. Unfortunely when i draw a new image in the main JPanel, the images that i drew before disappear, leaving only the last drawn image in the JPanel. Is there a way to keep all the images printed on the screen?