Creating and using a font
This example creates a Label object, and assigns to it a
plain Helvetica font of size 36 points (half an inch high).:
Label
timeDisplay = new Label ("");
timeDisplay.setFont (new Font
("helvetica", Font.PLAIN, 36));
This example creates a font and enables it in the current
graphics context. All subsequent text methods will then use that font.
g.setFont
(new Font ("helvetica", Font.PLAIN, 36));
g.drawString ("hello", 5, 5);
Back to
top

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg
|