Write a JAVA Applet Program?

2008-05-05 2:34 am
Write a JAVA Applet Program that have following:
1. It can draw some shapes on screen, i.e. circle, square, rectangle.
2. You need to use classes, such as Rectangle or Circle.
3. The applet should embedded inside a html page.
4. There will be animation which using thread.
5. Create a class Shape and using the code to show the concept of Polymorphism.

回答 (3)

2008-05-05 4:20 am
✔ 最佳答案
1 & 2. For drawing shapes, look for the keyword: "Java2D".

Sun's Tutorial on 2D Graphics:
http://java.sun.com/docs/books/tutorial/2d/index.html
aries;

Sun's documentation on the Java Standard Edition Application Programming Library:
http://java.sun.com/javase/6/docs/api/

3. Applet is Java programming, embedded within an HTML or XHTML web page.

The following link is a link to a good, free HTML tutorial. Applets use the tag called "applet". Note that the difference between HTML and XHTML is that XHTML is newer and is for new web pages and HTML is to maintain older websites that were written in HTML.
http://www.w3schools.com/xhtml/xhtml_intro.asp

4. I haven't done animation myself, but be aware that all drawing must be done on the GUI thread. Also, be aware that there are user-threads, daemon threads, and a single user-interface thread which is not to be confused with user-threads in general).
http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html
參考: Sun's Java Tutorial version 6 http://java.sun.com/docs/books/tutorial/deployment/applet/index.html Sun's Documentation for the version 6 API: http://java.sun.com/javase/6/docs/api/
2008-05-05 9:21 am
If you copy your homework from yahoo answer you will get caught.
2008-05-05 3:22 am
Try searching your answer all over the internet, there are plenty of answers :)


收錄日期: 2021-05-02 18:15:05
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080504183438AAuykD7

檢視 Wayback Machine 備份