java用代码画个五环,画五环的程序
java怎么绘制五环图案?
五环图片,其关键点是确定五个圆的中心点,只要确定了中心点,画圆就简单了,这个需要你计算了,可以先用笔在纸上画一画,想想思路,祝你成功
目前创新互联建站已为上千家的企业提供了网站建设、域名、网站空间、网站托管、服务器托管、企业网站设计、呼兰网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。
java怎么绘制五环图案
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package 临时文件;
import java.awt.*;
import javax.swing.*;
public class test{
public static void main(String[] args) {
MyFrame frame = new MyFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//1
frame.setSize(500,400); //2
frame.setVisible(true); //3
}
}
class MyFrame extends JFrame
{
public MyFrame()
{
// get screen dimensions
Toolkit kit = Toolkit.getDefaultToolkit();
Dimension screenSize=kit.getScreenSize();
int screenHeight = screenSize.height;
int screenWidth = screenSize.width;
// center frame in screen
setSize(screenHeight/2,screenWidth/2);
setLocation(screenHeight/4,screenWidth/4);
// set frame icon and title
Image img = kit.getImage("icon.gif");
setIconImage(img);
setTitle("myframe");
Container contentPane=getContentPane();
contentPane.add(new DrawRings());
}
}
用java写奥运五环。
设奥运5环为5个对象:A,B,C,D,E
则java程序如下:
ListInteger a=new ArrayListInteger(9);
ListInteger b=new ArrayListInteger();
ListInteger c=new ArrayListInteger();
ListInteger d=new ArrayListInteger();
ListInteger e=new ArrayListInteger();
ListInteger reslist =Arrays.asList(new Integer[] {1,2,3,4});
ListInteger res1list =Arrays.asList(new Integer[] {8,7,6,5});
b.add(reslist.get(0)).add(res1list.get(0));
c.add(reslist.get(1)).add(res1list.get(1));
d.add(reslist.get(2)).add(res1list.get(2));
e.add(reslist.get(3)).add(res1list.get(3));
文章标题:java用代码画个五环,画五环的程序
URL网址:http://ybzwz.com/article/heccdj.html