I am trying to do some tests on 2D "game"-programming by trying out different concepts to approach both designing and visualizing the environment.

In my baby-steps I went to go with Swing and using a JComponent's paintComponent() method to retrieve a Graphics2D object that I then use to visualize my game board.

It works quite well but I got to the point where I need to repeatedly check my whole game-model and update the view, basically once every 1/10 second something can change.

I paint the visuals by calling repaint() on my JComponent to cause a complete update of the view: I check every tile my game board has for information and paint that tile according to this data, for every tile on the board. But as I approach about 1000 - 4000 tiles that need to be painted, I come to the point where the painting of the whole view takes more than 100ms and thus a constant lag occurs when doing anything.

Now for the question(s): I am looking for a way, or opinions, on how to improve the performance of this approach. As not every tile on the board changes every "tick" I do not need to "repaint" this tile. But on the contrary, moving the visual area (camera offset) changes the position of every tile on the screen, so it would need to be repainted at a different position. Also, the later implementation of "would be" animations would need a constant update of the visual area, regardless of "happenings" or not. When looking at 3D games with high quality graphics (or even simple ones like minecraft) running at > 30 FPS, I am wondering weather or not I should immediately switch to OpenGL before running into even more problems graphics wise, or are there ways to improve the performance with algorithms checking for the right kind of changes both in the view and the model?