protected String getLabelText(String path) throws IOException {
    InputStream is = this.getClass().getResourceAsStream(path);
    if (is != null) {
      Writer writer = new StringWriter();

      char[] buffer = new char[1024];
      try {
        Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        int n;
        while ((n = reader.read(buffer)) != -1) {
          writer.write(buffer, 0, n);
        }
      } finally {
        is.close();
      }
      return writer.toString();
    } else {
      System.err.println("Couldn't find file: " + path);
      return null;
    }
  }
protected String getLabelText(String path) throws IOException {
    InputStream is = this.getClass().getResourceAsStream(path);
    if (is != null) {
      Writer writer = new StringWriter();

      char[] buffer = new char[1024];
      try {
        Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        int n;
        while ((n = reader.read(buffer)) != -1) {
          writer.write(buffer, 0, n);
        }
      } finally {
        is.close();
      }
      return writer.toString();
    } else {
      System.err.println("Couldn't find file: " + path);
      return null;
    }
  }
protected String getLabelText ( String path ) throws IOException { InputStream is = this . getClass ( ) . getResourceAsStream ( path ) ; if ( is != null ) { Writer writer = new StringWriter ( ) ; char [ ] buffer = new char [ 1024 ] ; try { Reader reader = new BufferedReader ( new InputStreamReader ( is , "UTF-8" ) ) ; int n ; while ( ( n = reader . read ( buffer ) ) != - 1 ) { writer . write ( buffer , 0 , n ) ; } } finally { is . close ( ) ; } return writer . toString ( ) ; } else { System . err . println ( "Couldn't find file: " + path ) ; return null ; } }
Returns the full contents of a (assumed) text file for use in a label.

@param path
The path to the text file.
@return The contents of the file as a String.
@throws IOException
thrown if the file is unable to be read.
Returns the full contents of a ( assumed ) text file for use in a label .