import java.awt.*;
import java.awt.Graphics;
import java.awt.event.*;
import java.io.*;
class pro extends Frame{
int t;
Frame f;
double c[]=new double[500];
public static void main(String[] args){
Frame f=new pro();
f.setTitle("pro");
f.setSize(800,800);
f.setBackground(Color.yellow);
f.show();
}
pro() {
addWindowListener(new stopwin());
try{
BufferedReader br =new BufferedReader(new FileReader("data.txt"));
String str;
String x[]=new String[2];
for(int i=0; i<90; i++){
str = br.readLine();
x=str.split(",");
t=Integer.valueOf(x[0]);
c[t]=Double.valueOf(x[1]);
}
br.close();
}
catch(IOException e){System.out.println("入出力エラーです。");}
}
class stopwin extends WindowAdapter{
public void windowClosing(WindowEvent we){System.exit(0);}
}
public void paint( Graphics g ) {
int c1,c2;
g.setColor(Color.yellow);
g.fillRect(0,0,800,800);
g.setColor(Color.red);
g.drawLine(100,600,600,600);
g.drawLine(100,600,100,100);
for (t=1;t<90;t++){
c1=(int)(200*c[t]);
c2=(int)(200*c[t+1]);
g.drawLine(100+5*t,600-c1,100+5*t+5,600-c2);
}
}
}
最終更新:2010年11月30日 15:06