アットウィキロゴ

じゃヴぁ0230

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

public class game0230 extends JPanel{
public static void main(String[] args){
JFrame frame = new JFrame();
game0230 app = new game0230();
frame.getContentPane().add(app);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(10, 10, 300, 200);
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年02月16日 23:57