I'm not very well versed in Java graphics and I am having trouble sorting through all these Graphics2D, BufferedImage, etc. classes.
I currently have a program that is a little sluggish on the animation front. I am inheriting from JPanel so double-buffering is taken care of, so no flicker, but the motion is not smooth. So, I have decided that reducing the amount of drawing may fix this. The best idea I came up with is to draw the static part of the JPanel one time. The JPanel is basically a grid that an object slides across. I want to draw this grid ahead of time and then draw the object and its path dynamically
So, in paintComponent I want to call something to draw the previously-drawn-to-something (BufferedImage? Graphics2D?) static grid and then go on with drawing my object and its path over top of this. Is this possible and, if so, how do I do so? Or are there better solutions?
Thanks guys!
I currently have a program that is a little sluggish on the animation front. I am inheriting from JPanel so double-buffering is taken care of, so no flicker, but the motion is not smooth. So, I have decided that reducing the amount of drawing may fix this. The best idea I came up with is to draw the static part of the JPanel one time. The JPanel is basically a grid that an object slides across. I want to draw this grid ahead of time and then draw the object and its path dynamically
So, in paintComponent I want to call something to draw the previously-drawn-to-something (BufferedImage? Graphics2D?) static grid and then go on with drawing my object and its path over top of this. Is this possible and, if so, how do I do so? Or are there better solutions?
Thanks guys!