private String readFile ( String fileName ) { String text ; try { try ( Reader r = new FileReader ( fileName ) ) { text = Kit . readReader ( r ) ; } } catch ( IOException ex ) { MessageDialogWrapper . showMessageDialog ( this , ex . getMessage ( ) , "Error reading " + fileName , JOptionPane . ERROR_MESSAGE ) ; text = null ; } return text ; }
Reads the file with the given name and returns its contents as a String .