Java tutorial
//package com.java2s; public class Main { public static Boolean DEBUG = true; public static void printToConsole(String message) { if (message.isEmpty() || !DEBUG) return; int len = 50 - message.length(); String spacer = ""; for (int i = 0; i < len / 2; i++) { spacer += " "; } System.out.println(""); System.out.println("**************************************************"); System.out.println(spacer + message); System.out.println("**************************************************"); System.out.println(""); } }