private void updateFont(){
  String fontName=fontList.getValue();
  Integer fontSize=FALLBACK_FONT_SIZE;
  try {
    fontSize=Integer.parseInt(fontSizeList.getValue());
  }
 catch (  NumberFormatException ex) {
  }
  font=new Font(fontName,Font.PLAIN,fontSize);
  preview.setFont(font);
}

private void updateFont ( ) { String fontName = fontList . getValue ( ) ; Integer fontSize = FALLBACK_FONT_SIZE ; try { fontSize = Integer . parseInt ( fontSizeList . getValue ( ) ) ; } catch ( NumberFormatException ex ) { } font = new Font ( fontName , Font . PLAIN , fontSize ) ; preview . setFont ( font ) ; }
creates a new font based on the current settings and also updates the preview . the created font is not only used for the preview , but also to return it when requested from the caller .
