https://blog.csdn.net/uber001/article/details/51384551packagecom.saiermeng;importjava.applet.Applet;importjava.awt.Color;importjava.awt.Font;importjava.awt.Graphics;publicclasswuhuanextendsApplet{privateColorclr[]={Color.blue,Color.black,Color.red,Color.yellow,Color.green};//clr[]存储颜色privateint[]x={100,136,172,118,154};//x[]存储圆心的x坐标privateint[]y={60,60,60,91,91};//y[]存储圆心的y坐标privateint[][]xy={{100,60},{136,60},{172,60},{118,91},{154,91}};//存储圆心的坐标privateintr=20,d=40;publicvoidpaint(Graphicsg)//画图方法{Fontfont=newFont("楷体",Font.PLAIN,20);//文字字体、大小g.setFont(font);for(inti=0;i<5;i++)//循环5次,画5个圆环{g.setColor(clr[i]);g.drawOval(x[i],y[i],d,d);//d代表椭圆外切矩形的长宽,相等代表圆}g.setColor(Color.blue);//设置颜色g.setFont(font);g.drawString("奥运五环旗",120,169);}}---------------------作者:uber001来源:CSDN原文:https://blog.csdn.net/uber001/article/details/51384551版权声明:本文为博主原创文章,转载请附上博文链接!