Java: Java Programming For Beginners a simple Start To Java Programming (Written By a software Engineer)


Download 0.82 Mb.
Pdf ko'rish
bet73/95
Sana09.01.2022
Hajmi0.82 Mb.
#261112
1   ...   69   70   71   72   73   74   75   76   ...   95
Bog'liq
Java Programming For Beginners - A Simple Start to Java Programming ( PDFDrive )

A “Welcome, World” Applet
The accompanying is a basic applet named BasicApplet.java:
import java.applet.*;
import java.awt.*;
public class BasicApplet extends Applet {
public void paint (Graphics gx) {
gx.drawstring (“Say Hello To The World!”, 35, 70);
}
These import explanations bring the classes into the extent of our applet class:
java.awt.graphics
java.applet.applet
Without  those  import  explanations,  the  Java  compiler  would  not  perceive  the  classes
Applet and Graphics, which the applet class alludes to.
The Applet Class
Each applet is an augmentation of the java.applet.applet class. The base Applet class gives
techniques  that  a  determined  Applet  class  may  call  to  get  data  and  administrations  from
the program connection. These incorporate techniques that do the accompanying:
Get parameters of the applet
Get the system area of the HTML record that contains the applet
Get the system area of the applet class registry
Print a status message in the program
Fetch a picture
Fetch a sound
Play a sound
Perform resizing of the applet
Moreover,  the  Applet  class  gives  an  interface  by  which  the  viewer  or  program  gets  data


about the applet and controls the applet’s execution. The viewer might:
Request data about the form, creator and copyright of the applet
Request a depiction of the parameters the applet perceives
Perform applet initialization
Perform applet destruction
Begin the execution of the applet
Stop the execution of the applet
The Applet class allows default usage of each of these routines. Those executions may be
overridden  as  essential.  The  “Say  Hello  To  The  World!”  applet  is  complete  in  itself.
However, as part of the implementation, only the paint() function is over-ridden.


A Simple Start to jQuery, JavaScript, and Html5 for
Beginners
Written by a Software Engineer


By
Scott Sanderson

Download 0.82 Mb.

Do'stlaringiz bilan baham:
1   ...   69   70   71   72   73   74   75   76   ...   95




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling