title: How to limit characters on a line and make the display go to the next line
body: <p>I'd like some help with a Java assignment, if it's no problem. We've just been getting started, but my teacher wants us to do a bunch of research on our own and I can't figure out how to do the homework.</p>
  
  <p>We have an assignment where he's given us the lines to 10 different speeches, and we have to use objective oriented coding to display the entire thing. I figured out so far how to set up variables to link to the first file and have things displayed on the screen, but he wants us to limit how many characters are on each line so he doesn't have to scroll sideways forever to read a speech on a single line. This leaves me in a position where I'd be making new variables for every sentence of every speech for the next few hours, and I figure there has to be a more efficient way. So, I asked my friend (who took the class last year) for advice, and he recommended using a for loop to scan for spaces after a certain amount of characters and jump to the next line to continue, but I have no idea how to do any of this. All I have so far is the base file that our teacher told us to use, and the beginning of the first of 10 speeches. </p>
  
  <pre><code>/**
  * TextWriter is a program that uses objective coding to display 10 political speeches
   * @author () 
   * @version (10/12/16)
   */
  public class TextWriter {
      private String textToDisplay;//text to be displayed
      public TextWriter() {
          textToDisplay = "";
      }
      public TextWriter(String inputText) {
      textToDisplay = inputText;
      }
      public void clearTextToDisplay() {
          textToDisplay = "";
      }
      public void setTextToDisplay(String inputText) {
          textToDisplay = inputText;
      }
      public String getTextToDisplay() {
          return textToDisplay;
      }
      public void display() {
          System.out.println(textToDisplay);
      }
  }
  </code></pre>
  
  <p>and the second one,</p>
  
  <pre><code> /**
   * Displays Washington's Farewell speech using objective oriented coding.
   * @author () 
   * @version (10/12/16)
   */
  public class WashingtonFarewellDriver {
      public static void main(String[] args) {
          TextWriter wf1;
          wf1 = new TextWriter();
          wf1.setTextToDisplay("Friends and Citizens: The period for a new election of a citizen to administer the executive government of the United States being not far distant, and the time actually arrived when your thoughts must be employed in designating the person who is to be clothed with that important trust, it appears to me proper, especially as it may conduce to a more distinct expression of the public voice, that I should now apprise you of the resolution I have formed, to decline being considered among the number of those out of whom a choice is to be made.");
          wf1.display();
          TextWriter wf2;
          wf2 = new TextWriter("I beg you, at the same time, to do me the justice to be assured that this resolution has not been taken without a strict regard to all the considerations appertaining to the relation which binds a dutiful citizen to his country; and that in withdrawing the tender of service, which silence in my situation might imply, I am influenced by no diminution of zeal for your future interest, no deficiency of grateful respect for your past kindness, but am supported by a full conviction that the step is compatible with both.");
          wf2.display();
          TextWriter wf3;
          wf3 = new TextWriter("The acceptance of, and continuance hitherto in, the office to which your suffrages have twice called me have been a uniform sacrifice of inclination to the opinion of duty and to a deference for what appeared to be your desire. I constantly hoped that it would have been much earlier in my power, consistently with motives which I was not at liberty to disregard, to return to that retirement from which I had been reluctantly drawn.");
          wf3.display();
      }
  }
  </code></pre>
  
  <p>(hopefully that's formatted right)
  I hope that it's ok that I'm asking for homework help, because it does seem to be kind of looked down upon, but I'm pretty confused and hopefully someone can explain what's going on a little more than my teacher.
  Thank you! If there's any questions, I might be able to answer them too.</p>