title: How can i let g.drawstring handle \n?
body: <p>Hi I am making a quiz application. I would like to draw the question on the screen. If the question is too long, I place a \n in the string so it should go to a newline. But g.drawstring doesn't recognize this \n.</p>
  
  <p>This is my code :</p>
  
  <pre><code>/* Draw the question*/
  StringBuilder sb = new StringBuilder($question.getQuestion());
  
  int x = 0;
  while ((x = sb.indexOf(" ", x + 20)) != -1){
      sb.replace(x, x + 1, "\n");
  }
  
  System.out.println(sb.toString());
  
  g.drawString(sb.toString(), 125, 120);
  </code></pre>
  
  <p>The output I get in my console is : <br/>
  Which engineer made the <br/>
  Eiffel Tower in Paris?</p>
  
  <p>So the code is working, how can I let g.drawstring handle this string? Because it draws something like this : Which engineer made theEiffel Tower in Paris. So It doesn't read the \n and just pastes the words together.</p>
  
  <p>Thanks!</p>