question: private boolean checkStringLength ( String string , String orientation , String fontName , int fontSize ) { Font font = new Font ( fontName , Font . PLAIN , fontSize ) ; JLabel label = new JLabel ( ) ; FontMetrics metrics = label . getFontMetrics ( font ) ; int stringWidth = metrics . stringWidth ( string ) ; return stringWidth <= getPageSize ( orientation ) . width ; }
target:  Checks to see if the the string fits on the page.