资源描述:
《我做的动态字体显示源代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、我做的动态字体显示源代码,可以作为学习样本packagebase;importjava.awt.Color;importjava.awt.Frame;importjava.awt.Graphics;importjava.awt.event.KeyAdapter;importjava.awt.event.KeyEvent;importjava.awt.event.WindowAdapter;importjava.awt.event.WindowEvent;importjava.util.ArrayList;importjava.util
2、.List;importjavax.swing.JFrame;publicclassXingFrameextendsFrame{publicstaticvoidmain(Stringargs[]){XingFramef=newXingFrame();f.addKeyListener(newKeyAdapter(){publicvoidkeyReleased(KeyEventke){if((ke.getKeyCode()==KeyEvent.VK_ENTER)
3、
4、(ke.getKeyCode()==KeyEvent.VK_SPACE))
5、{System.exit(0);}}});}Ballball;Listpoints=null;ThreadthreadA;booleanflag;publicXingFrame(){points=newArrayList();points.add(newPoint(100,100));points.add(newPoint(150,150));points.add(newPoint(200,100));points.add(newPoint(150,150));points.add(newPoint(50,
6、150));points.add(newPoint(250,150));points.add(newPoint(150,150));points.add(newPoint(150,200));points.add(newPoint(50,200));points.add(newPoint(250,200));points.add(newPoint(150,200));points.add(newPoint(150,250));points.add(newPoint(50,250));points.add(newPoint(250,25
7、0));points.add(newPoint(150,250));points.add(newPoint(100,300));points.add(newPoint(50,300));points.add(newPoint(100,300));points.add(newPoint(150,250));points.add(newPoint(200,300));points.add(newPoint(250,300));//以下过渡到丽points.add(newPoint(300,300));//y=250,2508、ints.add(newPoint(300,200));points.add(newPoint(350,250));points.add(newPoint(300,200));points.add(newPoint(300,100));//x=300,509、int(375,300));points.add(newPoint(350,275));points.add(newPoint(375,300));points.add(newPoint(425,300));//y=250,37510、;points.add(newPoint(500,300));points.add(newPoint(475,275));points.add(newPoint(500,300));//过渡到南points.add(ne