src/com/mmpp/motivationapp/backend/Motivator.java
public void importMessagesFromFile(String filename) {
		try {
			InputStream stream = getClass().getResourceAsStream(filename);
			BufferedReader in = new BufferedReader(new InputStreamReader(stream));
			while(in.ready()) {
				String s = in.readLine();
				addMessage(s);
			}
			in.close();
		} catch (Exception e) {
			JOptionPane.showMessageDialog(null, e.getStackTrace(), "Error", JOptionPane.INFORMATION_MESSAGE);
		}
	}
/**
	 * Loads preset messages from a text file to the message box
	 * @param filename the name of the text file
	 */
Loads preset messages from a text file to the message box
@param filename the name of the text file
Loads preset messages from a text file to the message box @param filename the name of the text file
public void importMessagesFromFile(String filename) {
		try {
			InputStream stream = getClass().getResourceAsStream(filename);
			BufferedReader in = new BufferedReader(new InputStreamReader(stream));
			while(in.ready()) {
				String s = in.readLine();
				addMessage(s);
			}
			in.close();
		} catch (Exception e) {
			JOptionPane.showMessageDialog(null, e.getStackTrace(), "Error", JOptionPane.INFORMATION_MESSAGE);
		}
	}
public void importMessagesFromFile ( String filename ) { try { InputStream stream = getClass ( ) . getResourceAsStream ( filename ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( stream ) ) ; while ( in . ready ( ) ) { String s = in . readLine ( ) ; addMessage ( s ) ; } in . close ( ) ; } catch ( Exception e ) { JOptionPane . showMessageDialog ( null , e . getStackTrace ( ) , "Error" , JOptionPane . INFORMATION_MESSAGE ) ; } }
Loads preset messages from a text file to the message box
 @param filename the name of the text file
Loads preset messages from a text file to the message box @param filename the name of the text file