7

package chapter12;
import java.awt.*;
import java.awt.event.*;

public class test_19
{
public static void main(String arg[])
{
Frame f = new Frame("GraphicsText");
f.setBounds(100,100,230,230);
Image img = f.getToolkit().getImage("earth.jpg");
f.setVisible(true);
f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}
);
f.getGraphics().drawImage(img,0,0,f);
}
};

posted on 2017-03-11 21:37  tuzhuo  阅读(84)  评论(0编辑  收藏  举报