java - How to Double-Buffer JLayeredPane -
I am currently creating a path-laying tile game in Java, where I am using ZLARPEN with multiple layers I am The game runs fine, but the repetition method is called every time, the whole panel flicker.
Now I have a timer running game, where every tick automatically tiles a path with the path in which I have kept it. Naturally, I will need to update the screen to display the user's changes, but the problem is that the rearrangement method is redrawed on all layers of layerpane, causing the flicker on the map area of each tick screen. Will happen. Although it is tolerant, I would like to get rid of it, so it looks good.
I have researched the use of double buffering and have also decided to double the pane to correct the buffer (such as the pen. SetWood (true)), but different implementations There was no fate together. Is there a way to pull the entire panel with all the layers for every tick in an external buffer, then copy it to the main screen in one?
Thanks
Comments
Post a Comment