首页 > 编程语言 > 详细

please tell me the error about java Graphics

时间:2015-04-23 23:04:11      阅读:218      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!