アットウィキロゴ

j1009

import java.awt.*;
import java.awt.event.*; // For event
import java.io.*; // For File
import java.awt.image.*; // For BufferedImage
import javax.imageio.*; // For ImageIO

public class game1009 extends Frame {
   BufferedImage off; 
    
public static void main(String[] args) {
       game1009 f = new game1009(); 
       f.setBounds([[100]],100,300,300); 
       f.setVisible(true); 
}

game1009() {
       addWindowListener([[new]] WindowAdapter() { 
           public void windowClosing(WindowEvent e) { 
               System.exit(0); 
}
});
       try { 
           File imgfile = new File("harada.jpg");  //  [[ファイル]]オブジェクト作成 
           off = ImageIO.read(imgfile);     //  読みだす 
       } catch (Exception e) { } 

try {
    File imgfile2 = new File("outfile.jpg");  //  ファイルオブジェクト 
    ImageIO.[[write]](off, "jpg", imgfile2);     //  書きだす 
} catch (Exception e) {}

}

public void paint(Graphics g) {
       g.drawImage(off,50,50,this); 
}
}
最終更新:2011年03月06日 01:48