Java Reference
In-Depth Information
WelcomeApplet.java
10/4/2007
1
/*
2
Chapter 2:
Welcome to My Day
3
Programmer: J. Starks
4
Date:
October 4, 2007
5
Filename:
WelcomeApplet.java
6
Purpose:
This project displays a welcome message, the user's
7
name, the system date, and an image in an applet.
8
*/
9
10
import java.util. Date ;
11
import java.awt.*;
12
import java.applet.*;
13
14
public class WelcomeApplet extends Applet
15
{
16
public void paint ( Graphics g )
17
{
18
Date currentDate = new Date () ; // Date constructor
19
g.drawString ( "Welcome to my day!" ,200,70 ) ;
20
g.drawString ( "Daily planner for Linda Nunez" ,200,100 ) ;
21
g.drawString ( currentDate.toString () ,200,130 ) ;
22
Image smile; // declare an Image object
23
smile = getImage ( getDocumentBase () , "Smile.gif" ) ;
24
g.drawImage ( smile,10,10, this ) ;
25
setBackground ( Color .cyan ) ;
26
}
27
}
FIGURE 2-68
7. Retrieve the printout from the printer.
OTHER WAYS
1. On Standard
toolbar, click Print
button
2. Press CTRL + P , click
OK button
Text Pad Settings
In TextPad version 4.7 and above, current line highlighting
may be enabled to delineate the line of code containing the
insertion point. The highlight is not the same as a selection
highlight. Rather, it is a slight shadow behind the text to
assist programmers in following the line of code across the
screen. This new feature may be turned on or off in the
Preferences dialog box, as discussed in Appendix C.
Search WWH ::




Custom Search