java get text string width

Java FontMetrics Factory Methods

java.awt.FontMetrics is an abstract class that maintains the metadata of a font. The metadata includes such information how font letters should adjust with the previous line and next line. The characters like h, p, l, j etc have some special attention in adjusting with other characters in the line. The…