[Solved] Does this work for anyone? [closed]


  1. 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

  2. Don’t invoke repaint() from any painting method. This will cause an infinite loop.

  3. Don’t use sleeping code inside a painting method. If you want animation then use a Swing Timer

  4. Don’t read images from a painting method. The image should be read once when the class is created.

  5. Class name start with an upper case character. “demo_image” should be “DemoImage”.

4

solved Does this work for anyone? [closed]