SlideServe
Menu
Préférences
© SlideServe · v2026

Java Timer and Applet Basics for Web Development

alexiab avatar
6 diapositives · 196 Views · Jan 04, 2020

Learn how to utilize javax.swing.Timer for timing tasks and Java applets for web browsers. Understand differences between applets and applications, and grasp basics of HTML layout managers.

Java Timer and Applet Basics for Web Development - slide 1
01 / 6Java Timer and Applet Basics for Web Development
1 / 17

Télécharger la présentation

Java Timer and Applet Basics for Web Development
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Timer in Java • javax.swing.Timer – (getDelay, setDelay, setRepeats, isRepeats, start, stop, isRunning; ActionListner: actionPerformed) • JProgressBar – (getMinimum, setMinimum, getMaximum, setMaximum, getValue, setValue, getOrientation, setOrientation)

  2. Java Applet • HTML/XHTML • Web browsers with Java plug-in/Applet container • Load the class • Create an object • Call init, start, paint • Applet Life-Cycle methods: init, start, stop, and destroy.

  3. Applet vs. Application • JApplet vs. JFrame/JPanel • An applet can always be converted to an application • An application can be converted to an applet if no applet security rules are violated.

  4. Simple HTML Example <html> <head> <title>One Minute Timer</title> </head> <body> <applet code = "TestTimer.class" width = 270 height = 300> </applet> </body> </html>

  5. An Example

  6. Layout Managers • null: absolute positioning • FlowLayout: sequentially form left to right; default for JPanel • BorderLayout: five areas: NORTH, SOUTH, EAST, WEST, and CENTER; default for JFrame • GridLayout: rows and columns