码迷,mamicode.com
首页 > 编程语言 > 详细

please tell me the error about java Graphics

时间:2015-04-23 23:06:09      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

this is the code:

public class paint extends JFrame{
public paint(){
setLayout(new FlowLayout());
setLocation(0, 0);
setSize(200, 200);

setDefaultCloseOperation(DISPOSE_ON_CLOSE);
Container con=getContentPane();
con.add(new draw());





}


public static void main(String args[]){

new paint().setVisible(true);

}

class draw extends JPanel{

 

@Override
public void paint(Graphics g) {
// TODO 自动生成的方法存根
//super.paint(g);

g.drawRect(10, 10, 60, 60);
g.drawLine(70, 80, 180, 50);
System.out.print("fuck you");

}


}
}

please tell me the error about java Graphics

标签:

原文地址:http://www.cnblogs.com/mafeng/p/4451937.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!