2 Replies Latest reply: Jun 20, 2013 4:47 AM by KailasChougule RSS

    console output

    eljoshy0

      Is it possible to align output text to the console?

       

      I'm printing a UI to the console which gives users the ability to select an option

       

      System.out.printf("*********************%n");

      System.out.printf("Welcome to the system%n");

      System.out.printf("Please select an select an option%n");

      System.out.printf("1 - Login with username and password%n");

      System.out.printf("2 - Create an account%n");

      System.out.printf("3 - Options%n");

      System.out.printf("4 - Exit%n");

      System.out.printf("*********************%n");


      I was wondering if I can format this text to be aligned to a certain side. Or columns if not, but I prefer alignment. Also is there a more efficient way to write a large paragraph to be output(like above)?


      Thank you!