アットウィキロゴ

pろ09

import java.awt.*;
import java.awt.event.*;
import java.io.*;


class pro extends Frame {

public static void main(String [] args) {
     Frame f=[[new]] pro(); 
     f.setTitle("pro"); 
     f.setSize(500,500); 
     f.setBackground(Color.yellow);         
     f.setVisible(true); 
 } 

pro(){

int w,h,m,n;
w=232;
h=657;
int memor[][]=new int[h][w];
int memog[][]=new int[h][w];
int memob[][]=new int[h][w];

try{
   BufferedReader br =
     new BufferedReader(new FileReader("test.[[txt]]"));

String[] test = new String[w*h];
String str;
String x[]=new String[5];
   for(int i=0; i<w*h; i++){
      str = br.readLine();
  x=str.split(",");    
m=Integer.valueOf(x[0]);
n=Integer.valueOf(x[1]);
memor[m][n]=Integer.valueOf(x[2]);
memog[m][n]=Integer.valueOf(x[3]);
memob[m][n]=Integer.valueOf(x[4]);
   }

   br.close();
}
catch(IOException e){
   System.out.println("入出力エラーです。");
}
addWindowListener(new stopwin());
}
class stopwin extends WindowAdapter{
 public void windowClosing(WindowEvent we){System.exit(0);} 
 } 


public void paint(Graphics g){
g.setColor(Color.blue);
g.drawRect(100,100,200,300);
}

}
最終更新:2010年10月18日 02:20