title: Java Scanner String input
body: <p>I'm writing a program that uses an Event class, which has in it an instance of a calendar, and a description of type String.  The method to create an event uses a Scanner to take in a month, day, year, hour, minute, and a description.  The problem I'm having is that the Scanner.next() method only returns the first word before a space.  So if the input is "My Birthday", the description of that instance of an Event is simply "My".</p>
  
  <p>I did some research and found that people used Scanner.nextLine() for this issue, but when I try this, it just skips past where the input should go.  Here is what a section of my code looks like:</p>
  
  <pre><code>System.out.print("Please enter the event description: ");
  String input = scan.nextLine();
  e.setDescription(input);
  System.out.println("Event description" + e.description);
  e.time.set(year, month-1, day, hour, min);
  addEvent(e);
  System.out.println("Event: "+ e.time.getTime());    
  </code></pre>
  
  <p>And this is the output I get:</p>
  
  <pre><code>Please enter the event description: Event description
  Event: Thu Mar 22 11:11:48 EDT 2012
  </code></pre>
  
  <p>It skips past the space to input the description String, and as a result, the description (which is initially set to a blank space - " "), is never changed.</p>
  
  <p>How can I fix this?</p>