BicepBuddyApp/src/main/java/Messaging/DMController.java
public void populateMessages(JTextArea messageField) {
		// first get the sorted message list
		updateMessages();
		List<Message> sortedMessages = dm.getSorted();
		if(getNumMessages() != sortedMessages.size()) {
			Master.appLogger.info(":: Populating messages");
			setNumMessages(sortedMessages.size());
			messageField.setText("");
			
			for(int i = 0; i < sortedMessages.size(); i++) {
				//for each message, print the date, then the sender, then the message.
				addMessage(messageField, sortedMessages.get(i));
			}
			messageField.setCaretPosition(messageField.getDocument().getLength());
		}
		
	}
/**
	 * Populate messages to the JtextArea upon receiving updated data.
	 *
	 * @param messageField the message field
	 */
Populate messages to the JtextArea upon receiving updated data.
@param messageField the message field
Populate messages to the JtextArea upon receiving updated data . @param messageField the message field
public void populateMessages(JTextArea messageField) {
		updateMessages();
		List<Message> sortedMessages = dm.getSorted();
		if(getNumMessages() != sortedMessages.size()) {
			Master.appLogger.info(":: Populating messages");
			setNumMessages(sortedMessages.size());
			messageField.setText("");
			for(int i = 0; i < sortedMessages.size(); i++) {
				addMessage(messageField, sortedMessages.get(i));
			}
			messageField.setCaretPosition(messageField.getDocument().getLength());
		}
	}
public void populateMessages ( JTextArea messageField ) { updateMessages ( ) ; List < Message > sortedMessages = dm . getSorted ( ) ; if ( getNumMessages ( ) != sortedMessages . size ( ) ) { Master . appLogger . info ( ":: Populating messages" ) ; setNumMessages ( sortedMessages . size ( ) ) ; messageField . setText ( "" ) ; for ( int i = 0 ; i < sortedMessages . size ( ) ; i ++ ) { addMessage ( messageField , sortedMessages . get ( i ) ) ; } messageField . setCaretPosition ( messageField . getDocument ( ) . getLength ( ) ) ; } }
Populate messages to the JtextArea upon receiving updated data.
Populate messages to the JtextArea upon receiving updated data .
// first get the sorted message list //for each message, print the date, then the sender, then the message.