title: Printing a calendar
body: <p>I know how to create normal calendar which would be something like this.</p>
  
  <p>code:</p>
  
  <pre><code>import java.text.SimpleDateFormat;
  import java.util.Calendar;
  import java.util.GregorianCalendar;
  
  public class CalendarDateExample {
  
      public static void main(String[] args) {
          // Create an instance of a GregorianCalendar
          Calendar calendar = new GregorianCalendar(2014, 1, 06);
  
          System.out.println("Year: " + calendar.get(Calendar.YEAR));
          System.out.println("Month: " + (calendar.get(Calendar.MONTH) + 1));
          System.out.println("Day: " + calendar.get(Calendar.DAY_OF_MONTH));
  
          // Format the output.
          SimpleDateFormat date_format = new SimpleDateFormat("yyyy-MM-dd");
          System.out.println(date_format.format(calendar.getTime()));
      }
  } 
  </code></pre>
  
  <p>Output :
      Year: 2014
      Month: 2
     Day: 6
     2014-02-06</p>
  
  <p>But how would display a calender for given month and year making it look like:</p>
  
  <pre><code>July 2005
     S  M  T  W Th  F  S
                   1  2 
     3  4  5  6  7  8  9  
    10 11 12 13 14 15 16 
    17 18 19 20 21 22 23 
    24 25 26 27 28 29 30 
    31 
  </code></pre>
  
  <p>I am new to java , would like know how to do it the way above. any help would be great! 
  thanks in advance</p>