I am writting a program that asks a user what the year and month are. After the user inputs the information the results needs to be displayed into a global string using JOptionPane GUI. I have been able to succesfully create the dialog boxes for the year and month but ahve been unsucessful with the output of the calendar. what am I missing?
[code] public class PrintCalendar {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String EnterYear = JOptionPane.showInputDialog("Enter a year:");
int year = Integer.parseInt(EnterYear);
String EnterMonth = JOptionPane.showInputDialog("Enter month in number between 1 and 12:");
int month = Integer.parseInt(EnterMonth);
printMonth(year, month);
}
public static void printMonth(int year, int month) {
printMonthTitle(year, month);
printMonthBody(year, month);
JOptionPane.showMessageDialog(null, month, + year, JOptionPane.PLAIN_MESSAGE);
}
public static void printMonthTitle(int year, int month) {
System.out.println(" " + getMonthName(month)
+ " " + year);
System.out.println("-----------------------------");
System.out.println(" Sun Mon Tue Wed Thu Fri Sat");
}
[code]