資源簡介
java繪圖java繪圖java繪圖java繪圖java繪圖java繪圖java繪圖java繪圖java繪圖

代碼片段和文件信息
import?java.util.*;
import?java.awt.*;
import?java.applet.*;
import?java.text.*;
public?class?Clock?extends?applet?implements?Runnable?{
????private?volatile?Thread?timer;???????//?The?thread?that?displays?clock
????private?int?lastxs?lastys?lastxm
????????????????lastym?lastxh?lastyh;??//?Dimensions?used?to?draw?hands?
????private?SimpleDateFormat?formatter;??//?Formats?the?date?displayed
????private?String?lastdate;?????????????//?String?to?hold?date?displayed
????private?Font?clockFaceFont;??????????//?Font?for?number?display?on?clock
????private?Date?currentDate;????????????//?Used?to?get?date?to?display
????private?Color?handColor;?????????????//?Color?of?main?hands?and?dial
????private?Color?numberColor;???????????//?Color?of?second?hand?and?numbers
????private?int?xcenter?=?80?ycenter?=?55;?//?Center?position
????public?void?init()?{
????????int?xy;
????????lastxs?=?lastys?=?lastxm?=?lastym?=?lastxh?=?lastyh?=?0;
????????formatter?=?new?SimpleDateFormat?(“EEE?MMM?dd?hh:mm:ss?yyyy“?
??????????????????????????????????????????Locale.getDefault());
????????currentDate?=?new?Date();
????????lastdate?=?formatter.format(currentDate);
????????clockFaceFont?=?new?Font(“Serif“?Font.PLAIN?14);
????????handColor?=?Color.blue;
????????numberColor?=?Color.darkGray;
????????try?{
????????????setBackground(new?Color(Integer.parseInt(getParameter(“bgcolor“)
?????????????????????????????????????????????????????16)));
????????}?catch?(NullPointerException?e)?{
????????}?catch?(NumberFormatException?e)?{
????????}
????????try?{
????????????handColor?=?new?Color(Integer.parseInt(getParameter(“fgcolor1“)
???????????????????????????????????????????????????16));
????????}?catch?(NullPointerException?e)?{
????????}?catch?(NumberFormatException?e)?{
????????}
????????try?{
????????????numberColor?=?new?Color(Integer.parseInt(getParameter(“fgcolor2“)
?????????????????????????????????????????????????????16));
????????}?catch?(NullPointerException?e)?{
????????}?catch?(NumberFormatException?e)?{
????????}
????????resize(300300);??????????????//?Set?clock?window?size
????}
????//?Paint?is?the?main?part?of?the?program
????public?void?update(Graphics?g)?{
????????int?xh?yh?xm?ym?xs?ys;
????????int?s?=?0?m?=?10?h?=?10;
????????String?today;
????????currentDate?=?new?Date();
????????
????????formatter.applyPattern(“s“);
????????try?{
????????????s?=?Integer.parseInt(formatter.format(currentDate));
????????}?catch?(NumberFormatException?n)?{
????????????s?=?0;
????????}
????????formatter.applyPattern(“m“);
????????try?{
????????????m?=?Integer.parseInt(formatter.format(currentDate));
????????}?catch?(NumberFormatException?n)?{
????????????m?=?10;
????????}????
????????formatter.applyPattern(“h“);
????????try?{
????????????h?=?Integer.parseInt(formatter.format(currentDate));
????????}?catch?(NumberFormatException?n)?{
????????????h?=?10;
????????}
????
????????//?Set?positio
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????33464??2008-11-14?15:02??java繪圖\電子資料\images\accp.swf
?????文件???????6718??2008-11-14?15:02??java繪圖\電子資料\images\ap
?????文件???????4937??2008-11-14?15:02??java繪圖\電子資料\images\backblue.gif
?????文件???????7257??2008-11-14?15:02??java繪圖\電子資料\images\bg-1.gif
?????文件??????43046??2008-11-14?15:02??java繪圖\電子資料\images\bg-1.jpg
?????文件???????5500??2008-11-14?15:02??java繪圖\電子資料\images\bg-3.gif
?????文件????????926??2008-11-14?15:02??java繪圖\電子資料\images\bg-left.gif
?????文件????????232??2008-11-14?15:02??java繪圖\電子資料\images\bg.gif
?????文件??????11229??2008-11-14?15:02??java繪圖\電子資料\images\cake.png
?????文件??????12572??2008-11-14?15:02??java繪圖\電子資料\images\cake1.png
?????文件???????8489??2008-11-14?15:02??java繪圖\電子資料\images\figure.gif
?????文件???????3840??2008-11-14?15:02??java繪圖\電子資料\images\fr
?????文件??????28433??2008-11-14?15:02??java繪圖\電子資料\images\line.jpg
?????文件??????20170??2008-11-14?15:02??java繪圖\電子資料\images\liner.jpg
?????文件??????21233??2008-11-14?15:02??java繪圖\電子資料\images\logo.jpg
?????文件??????21233??2008-11-14?15:02??java繪圖\電子資料\images\logo_jb-1.jpg
?????文件???????2189??2008-11-14?15:02??java繪圖\電子資料\images\next.gif
?????文件??????32724??2008-11-14?15:02??java繪圖\電子資料\images\pillar.jpg
?????文件???????2427??2008-11-14?15:02??java繪圖\電子資料\images\pre.gif
?????文件??????13007??2008-11-14?15:02??java繪圖\電子資料\images\spline.jpg
?????文件????????795??2008-11-14?15:02??java繪圖\電子資料\index.html
?????文件?????998665??2008-11-14?15:02??java繪圖\電子資料\JavaSE_GUIp1.pdf
?????文件?????189952??2008-11-14?15:02??java繪圖\電子資料\Java的GUI設計.ppt
?????文件?????164864??2008-11-14?15:02??java繪圖\電子資料\Java繪圖.ppt
?????文件???????1180??2008-11-14?15:02??java繪圖\電子資料\left.html
?????文件???????4963??2008-11-14?15:02??java繪圖\電子資料\right.html
?????文件???????6105??2008-11-14?15:02??java繪圖\電子資料\source\cake.jsp
?????文件???????6897??2008-11-14?15:02??java繪圖\電子資料\source\Clock.java
?????文件????????340??2008-11-14?15:02??java繪圖\電子資料\source\code\.classpath
?????文件????????285??2008-11-14?15:02??java繪圖\電子資料\source\code\.myme
............此處省略51個文件信息
- 上一篇:Java開發技術大全(500個源代碼).
- 下一篇:ANDROID小說閱讀軟件源代碼
評論
共有 條評論