-
Don’t override the paint() method. Custom painting is done by overriding the paintComponent() method of a JPanel (or JComponent) and then you add the panel to the applet
-
Don’t invoke repaint() from any painting method. This will cause an infinite loop.
-
Don’t use sleeping code inside a painting method. If you want animation then use a Swing Timer
-
Don’t read images from a painting method. The image should be read once when the class is created.
-
Class name start with an upper case character. “demo_image” should be “DemoImage”.
4
solved Does this work for anyone? [closed]