September 2005
Beginner
576 pages
13h 6m
English
You can use Java to present news headlines and other information in different ways. One special effect you might see on a web page or graphical user interface is text that fades to black. You also might see the reverse—text that brightens from black to white. This hour's workshop uses the Font and Color classes to create text that cycles in brightness from dark to bright. The text looks like an alert about impending danger, so the panel will be called Danger.
To make the class more useful, the text of the warning will be set as an argument to a constructor. The text that will be used in this example warns of a “Core Breach in Sector 12,” but you can substitute other threatening text of similar length.
Read now
Unlock full access