title: Formatting Text Output Java SE
body: <p>I am trying to print some ASCII art from a <strong>System.out.println</strong> in Java. When I do this though all the spacing in place in the source code goes away. What is printed out is a mess of nonsense that does not make any sense. Figure 1 shows what the source code looks like and what the ASCII art should look like. Figure 2 shows what the banner actually looks like when the program is run. </p>
  
  <p>My question is how can I print the ASCII art as expected? <strong>How can I print the ASCII art with the formatting that makes the banner readable?</strong> </p>
  
  <p>For instance with Python I could easily have this work by using triple quotes. Does Java have a similar text mechanism?</p>
  
  <p><a href="https://i.stack.imgur.com/ovLu9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ovLu9.png" alt="Figure 1: How the ASCII Art should look, how it is in the source code."></a>
  <em>Figure 1</em>: What the ASCII art should look like</p>
  
  <p><a href="https://i.stack.imgur.com/fyz8D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fyz8D.png" alt="enter image description here"></a>
  <em>Figure 2</em>: What the ASCII art looks like when the program is run</p>
  
  <p>Please see my source code as follows:</p>
  
  <pre><code>package Boring;
  
  import java.util.Scanner;
  
  public class EnchantedBoringLevel {
  
  
      public EnchantedBoringLevel () {
          System.out.println("\n\n\n\n\n\n\n\n\n\n\n");
      /*  System.out.println("\n" + 
  "EEEE           h              t         d     BBBB                          FFFF                  t  " +
  "E              h              t         d     B   B         ii              F                     t  " +
  "EEE  nnn   ccc hhh   aa nnn  ttt eee  ddd     BBBB  ooo rrr    nnn  ggg     FFF  ooo rrr eee  ss ttt " +
  "E    n  n c    h  h a a n  n  t  e e d  d     B   B o o r   ii n  n g g     F    o o r   e e  s   t  " +
  "EEEE n  n  ccc h  h aaa n  n  tt ee   ddd     BBBB  ooo r   ii n  n ggg     F    ooo r   ee  ss   tt " +
  "                                                                      g                              " +
  "                                                                     ggg                             " 
  );
  */
          System.out.println("***Enchanted Boring Forest***");
          System.out.println("Welcome to another boring level of this video game!\n\n\n\n");
          this.enchant();
      }
  
      public void enchant() {
  
          System.out.println("You find yourself in a magical forest all alone.\nYou hear music in the distance.\n" +
          "An elf appears and takes you to their tree house mansion.");
  
          System.out.print("The elf prince offers you three choices 1) invisible ring, 2) galactic sunglasses, 3) a map of the enchanted forest. Which do you choose?");
          Scanner enchanted_choice = new Scanner(System.in);
          String choice;
          choice = enchanted_choice.next();
  
          switch(new Integer(choice)) {
  
              case 1:
                  System.out.println("You chose the invisible ring");
                  new BoringInvisibleRing();
                  break;
              case 2:
                  System.out.println("You chose the galactic sunglasses");
                  new BoringGalacticSunglasses();
                  break;
              case 3:
                  System.out.println("You chose the map of the enchanted forest");
                  break;
              default:
                  System.out.println("You shot yourself in the face.");
  
          }
      }
  
  
  
  
  
  }
  </code></pre>