Java repaint not updating

Yes, calling paint() method raises compilation error.

Before the window is to be drawn with new data, the old data must be erased, else, both overwrite (not override) the other and finally the data is not readable.

It seems to depend on the matlab session i've opened; right now for example I have to resize the window for every line of code i type.

You could for instance, create an object Sprite, that has a Buffered Image, painting method, and position values.

you are use to it and we will use a Canvas to do our drawing...

Canvas are needed because we can apply a to them Buffe Startegy is the bumber of buffers we will use to draw "offscreen".

Can you make a small program that demos the problem?

Some alternative to not clearing the background would be 1) try having your sprites as animated GIF's (do not know how java handles gif animation, eg if it repaints the whole panel or what - easy to test) 2) do the sprite animation in separate JPanels which are positioned, perhaps via Overlay Layout or (gasp) null layout.

Search for java repaint not updating:

java repaint not updating-39java repaint not updating-36java repaint not updating-63java repaint not updating-42

If I understand your question correctly, this is not the solution that your are looking for. spontaneous painting, initiated by the environment 2.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “java repaint not updating”

  1. So today I’m going to share with you some dirty talk tips and examples that will help you figure out how to approach the naughty fun of talking in the sack and feel more comfortable about it.