1 / 29

Outline

Outline. Java Applet [ p.2 in Java-17-Applet.pdf ] Execution method [ p.11, 12 in Java-17-Applet.pdf ] Applet class Applet life cycle Graphics method AWT GUI with Listener. 1. Java Applet. Framework:. XXX.html. XXX.Java. XXX.Class. XXX.Class. 1. Java Applet (Example 1).

teleri
Download Presentation

Outline

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Outline Java Applet [p.2 in Java-17-Applet.pdf] Execution method [p.11, 12 in Java-17-Applet.pdf] Applet class Applet life cycle Graphics method AWT GUI with Listener

  2. 1. Java Applet Framework: XXX.html XXX.Java XXX.Class XXX.Class

  3. 1. Java Applet (Example 1) Align text left No constructor here [p.5 in Java-17-Applet.pdf] No main [p.9], setVisible [p.9], setTitle [p.9], setSize [p.10], setDefaultCloseOperation [p.10] methods as well Align top

  4. 1. Java Applet (Example 1) [p.26 in Java-17-Applet.pdf]

  5. 1. Java Applet (Example 1)

  6. Click here

  7. 3. Java Applet (Example 2) Example:

  8. 3. Java Applet (Example 2) Example:

  9. 3. Java Applet (Example 2) Example:

  10. 2. Execution Method The 1st method: Using the appletviewer FirstAppletDemo.html Description - The appletviewer command allows you to run applets outside of the context of a World-Wide Web browser. http://download.oracle.com/javase/1.3/docs/tooldocs/win32/appletviewer.html

  11. 2. Execution Method The 2nd method: Html

  12. 3. Applet Class Main Methods (Life cycle): init() – called exactly once in an applet's life, when the applet is first loaded start() – alled at least once in an applet's life, when the applet is started or restarted stop() – called at least once in an applet's life, when the browser leaves the page in which the applet is embedded destroy() – called exactly once in an applet's life, just before the browser unloads the applet http://www.cafeaulait.org/course/week5/28.html

  13. 4. Applet Life Cycle paint() http://www.cafeaulait.org/course/week5/28.html

  14. 4. Applet Life Cycle Example:

  15. 4. Applet Life Cycle Example:

  16. 4. Applet Life Cycle Example:

  17. 5. Graphics (0, 0) (250, 0) 90 輸出文字 60 (60, 90) (0, 250) (250, 250)

  18. 5. Graphics Example:

  19. 5. Graphics Example:

  20. 5. Graphics Example:

  21. 6. AWT GUI AWT (Abstract Windowing Toolkit): Label Button Checkbox Choice TextField List Scrollbar …

  22. 6. AWT GUI Example:

  23. 6. AWT GUI Example:

  24. 6. AWT GUI Example:

  25. 7. AWT GUI Example:

  26. 7. Listener Example:

  27. 7. AWT GUI Example:

  28. 7. AWT GUI Example:

  29. Weekly Sentence • No gains without pains

More Related