Okay, now I've been using drawImage in java for a while, and this has never happened before. Why can't it find "drawImage(java.awt.image.BufferedImage,<nulltype>,int,int)"
in my code?
import java.awt.*;
import javax.swing.*;
import javax.swing.JPanel;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.util.Arrays;
import javax.imageio.ImageIO;
public class imgtest extends JFrame{
BufferedImage img;
Graphics g2d;
/**
* Creates a new instance of imgtest
.
*/
public imgtest() {
File file = new File("test.png");
img = ImageIO.read(file);
}
/**
* @param args the command line arguments
*/
public void paint(Graphics g)
{
g2d = (Graphics2D)g;
g2d.drawImage(img, null, 0, 0);
}
public static void main(String[] args) {
imgtest i = new imgtest();
i.setSize(640,480);
i.setVisible(true);
i.repaint();
// TODO code application logic here
}
}