Class AppletTemplate
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----AppletTemplate
- public class AppletTemplate
- extends Applet
- implements Runnable
-
AppletTemplate()
-
-
getAppletInfo()
- Return information about this applet
-
getParameterInfo()
- Return information about this applet's parameters
-
getPreferredSize()
- Calculate the preferred size for this applet.
-
init()
- Initialize applet:
- read parameters, and set variables' values
- set value of the string to display
- resize applet to preferred size
-
paint(Graphics)
- Paint applet, use color for background, print string,
character and integer.
-
run()
- Do nothing but run the thread
-
start()
- Create a new thread, if none, and start it
-
stop()
- Stop thread
AppletTemplate
public AppletTemplate()
getAppletInfo
public String getAppletInfo()
- Return information about this applet
- Returns:
- Applet purpose and copyright notice
- Overrides:
- getAppletInfo in class Applet
getParameterInfo
public String[][] getParameterInfo()
- Return information about this applet's parameters
- Returns:
- Applet parameter list: names, types, and descriptions
- Overrides:
- getParameterInfo in class Applet
init
public void init()
- Initialize applet:
- read parameters, and set variables' values
- set value of the string to display
- resize applet to preferred size
- Overrides:
- init in class Applet
start
public void start()
- Create a new thread, if none, and start it
- Overrides:
- start in class Applet
stop
public void stop()
- Stop thread
- Overrides:
- stop in class Applet
run
public void run()
- Do nothing but run the thread
paint
public void paint(Graphics g)
- Paint applet, use color for background, print string,
character and integer.
- Parameters:
- g - Graphics instance for painting operations
- Overrides:
- paint in class Container
getPreferredSize
public Dimension getPreferredSize()
- Calculate the preferred size for this applet.
That size ensure that the whole string be enclosed inside the
applet bounds, taking in account insets too.
- Returns:
- Preferred size
- Overrides:
- getPreferredSize in class Container