The first three cases in drawString( ) are simple. Each aligns the string that is passed in
line to the left or right edge or to the center of the column, depending upon the alignment
style. The LEFTRIGHT case aligns both the left and right sides of the string. This means that
we need to calculate the remaining whitespace (the difference between the width of the string
and the width of the column) and distribute that space between each of the words. The last
method in this class advances the alignment style each time you click the mouse on the applet's
window.
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home