repaint function not working .. <p>i have a problem with the repaint function</p> <p>when i compile, the error is </p> <pre><code>pc3@pc3-desktop:~/Desktop$ javac LoadImageApp.java LoadImageApp.java:17: cannot find symbol symbol : method repaint(int,int,int,int,int) location: class java.awt.Graphics g.repaint(1000,0,0,1440,900) ^ 1 error </code></pre> <p>and this is my code --> </p> <pre><code>import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.io.*; import javax.imageio.*; import javax.swing.*; public class LoadImageApp extends Component { BufferedImage img; public void paint(Graphics g) { g.drawImage(img, 0, 0, null); super.update(g); g.repaint(1000,0,0,1440,900); } public LoadImageApp() { try{ img = ImageIO.read(new File("screenshot.jpg")); }catch(IOException e){} } public Dimension getPreferredSize() { if (img == null) { return new Dimension(100,100); } else { return new Dimension(img.getWidth(null), img.getHeight(null)); } } public static void main(String[] args) { JFrame f = new JFrame("Load Image "); f.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { System.exit(0); } }); f.add(new LoadImageApp()); f.pack(); f.setVisible(true); } } </code></pre> <p>can anyone tell me what is the problem ? i intend to do a program that is display the image and keep refreshing every 0.1 seconds . the image will be receive from other machine and every 0.1 seconds and the image will be keep override the old image .. </p> <p>thanks in advance for those who reply .. THANK YOU !!!!!!</p>