calendar for a given month of a given year, or of the current month and year. import java.util.*; import java.text.*; /** Print a month page. * Only works for the Western calendar. */ public class CalendarPage { /** The names of the months */ String[] months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; /** The days in each month. */ public final static int dom[] = { 31, 28, 31, 30, /* jan feb mar apr */ 31, 30, 31, 31, /* may jun jul aug */ 30, 31, 30, 31 /* sep oct nov dec */ }; /** Compute which days to put where, in the Cal panel */ public void print(int mm, int yy) { /** The number of days to leave blank at the start of this month */ int leadGap = 0; System.out.print(months[mm]); // print month and year System.out.print(" "); System.out.print(y...
Programming snippets. C , C++ , C# , Java , PHP , Blogging Tips, Self Help, Wellness,Marketing, Social Media tools