title: Code used to parse input throws InputMismatchException
body: <pre><code>while(inputbook.hasNext()){
      id = inputbook.nextInt();
      name = inputbook.next();
      year = inputbook.nextInt();
      price = inputbook.nextDouble();
      Book b = new Book(id,name,year,price);
      hmbook.put(id,b);
      Book b2 = hmbook.get(id);
      System.out.println(b2);
  
      getCb3();
      cb3.addItem(name);
  }
  </code></pre>
  
  <p>And this is the text file:</p>
  
  <pre><code>100 JAVA 2007 100.0
  200 C++ 2005 65.9
  300 Introduction 2008 120.0 
  </code></pre>
  
  <p>But I'm getting an <code>InputMismatch</code> exception:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.util.InputMismatchException
      at java.util.Scanner.throwFor(Unknown Source)
      at java.util.Scanner.next(Unknown Source)
      at java.util.Scanner.nextDouble(Unknown Source)
      at FirstFrame.loadFiles(FirstFrame.java:143)
      at FirstFrame.&lt;init&gt;(FirstFrame.java:712)
      at FirstFrame$7.run(FirstFrame.java:699)
      at java.awt.event.InvocationEvent.dispatch(Unknown Source)
      at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
      at java.awt.EventQueue.access$000(Unknown Source)
      at java.awt.EventQueue$1.run(Unknown Source)
      at java.awt.EventQueue$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)
  </code></pre>
  
  <p>This is the exception. Why does it happen?</p>