アットウィキロゴ

じゃヴぁ0616

import java.awt.*;
import java.awt.geom.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import java.io.IOException;
import java.io.*;

public class game0616 extends JFrame{

double c[][]=new double[6][6];
double y1[][]=new double[6][6];
double y2[][]=new double[6][6];
int s1,s2;
  
public static void main(String[] args){
    game0616 test = new game0616();

    test.addWindowListener(new WindowAdapter(){
      public void windowClosing(WindowEvent e){System.exit(0);}
    });

    test.setBounds( 0, 0, 700, 700);
    test.setVisible(true);
  }

game0616(){
}

public void paint(Graphics g){
double x,y,z;
int px,py;
int px1,px2,py1,py2;
    Graphics2D g2 = (Graphics2D)g;

    BufferedImage readImage = null;
    

    if (readImage == null){
      readImage = new BufferedImage(getWidth(), getHeight(),
        BufferedImage.TYPE_INT_BGR);
    }

    Graphics2D off = readImage.createGraphics();

    off.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
    RenderingHints.VALUE_ANTIALIAS_ON);

BasicStroke wideStroke = new BasicStroke(2.0f);
    off.setStroke(wideStroke);

off.setPaint(Color.red);
off.drawLine(100,600,200,300);    

off.drawString("夫婦の消費",100,100);  
off.drawString("妻の所得",600,400);
    
    if (readImage != null){g2.drawImage(readImage,0,0, this);}

    try {
      boolean result =
       ImageIO.write(readImage, "jpg", new File("sam.jpg"));
    } catch (Exception e) {
        e.printStackTrace();
    }
  }








}
最終更新:2011年02月25日 13:52