First, calculate the height of both strings: int leading = fm.getLeading(); int height = 2*stringHeight + leading; |
Now calculate the position of the first string: int y = (appletHeight - height )/2 + ascent; where x is computed as before |
The y-position of the second string is simply: y += stringHeight + leading; |