アットウィキロゴ

じゃヴぁ1018

import javax.swing.*;
import java.awt.*;

public class game1018 extends JPanel{

  public static void main(String[] args){
    JFrame frame = new JFrame();
    game1018 app = new game1018();
    frame.getContentPane().add(app);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setBounds(0, 0, 500, 500);
    frame.setTitle("タイトル");
    frame.setVisible(true);
  }

  public void paintComponent(Graphics g){
    g.setColor(Color.red);
    g.fillRect(40, 20, 200, 120);

    g.setColor(Color.blue);
    g.drawString("Hello Java2D", 10, 50);
  }
}
最終更新:2011年03月07日 00:14