import java.awt.*;
import javax.swing.*;
import java.awt.image.*;
public class ImageDemo extends JFrame{
private PixelGrabber pg;
private String file;
private Image image,temp;
private int width,height;
private int share=4;
private Graphics g;
public ImageDemo(){
super( "image test ");
file= "23.jpg ";
image=Toolkit.getDefaultToolkit().getImage(file);
BufferedImage buffimg=new BufferedImage(300,300,BufferedImage.TYPE_INT_RGB);
g=buffimg.getGraphics();
g.drawImage(image,0,0,200,200,this);System.out.println( "this ");
g.dispose();
this.setSize(300,300);
}
public static void main(String[] args){
ImageDemo id=new ImageDemo();
id.setVisible(true);
}
}
为什么这个程序的图像不能出来呀,请哪位大哥给小弟说一下。
小弟感激不尽
------解决方案--------------------
搞了N久,我也没能弄出来,郁闷了.