I am trying to print this to a dialog box. The code prints to console and prints, 1,2,3,4....12 to the dialog box. Can someone give me some advice on printing to a dialog box the verses to the dialog?
import javax.swing.*; // program uses class JOptionPane
public class TwelveDays
{
// main method begins execution of Java application
public static void main( String args[] )
{
int day = 1;
String verse = "";
for (day = 1; day <= 12; day++) {
JOptionPane.showMessageDialog(null, verse);
switch(day)
{
case 1:
System.out.println ("On the first day of Christmas my true love sent to me:" );
case 2:
System.out.println ("On the second day of Christmas my true love sent to me:");
case 3:
System.out.println ("On the thrid day of Christmas my true love sent to me:");
break;
case 4:
System.out.println ("On the fourth day of Christmas my true love sent to me:");
break;
case 5:
System.out.println ("On the fifth day of Christmas my true love sent to me:");
break;
case 6:
System.out.println ("On the sixth day of Christmas my true love sent to me:");
break;
case 7:
System.out.println ("On the seventh day of Christmas my true love sent to me:");
break;
case 8:
System.out.println ("On the eigth day of Christmas my true love sent to me:");
break;
case 9:
System.out.println ("On the ninth day of Christmas my true love sent to me:");
break;
case 10:
System.out.println ("On the tenth day of Christmas my true love sent to me:");
break;
case 11:
System.out.println ("On the eleventh day of Christmas my true love sent to me:");
break;
case 12:
System.out.println ("On the twelveth day of Christmas my true love sent to me:");
break;
}
switch(day)
{
case 12:
verse += "12 Drummers Drumming";
case 11:
verse += "Eleven Pipers Piping";
case 10:
verse += "Ten Lords a Leaping";
case 9:
verse += "Nine Ladies Dancing";
case 8:
verse += "Eight Maids a Milking";
case 7:
verse += "Seven Swans a Swimming";
case 6:
verse += "Six Geese a Laying";
case 5:
verse += "Five Golden Rings";
case 4:
verse += "Four Calling Birds";
case 3:
verse += "Three French Hens";
case 2:
verse += "Two Turtle Doves";
case 1:
verse += "a Partridge in a Pear Tree";
break;
}
}
} // end method main
} // end class twelveDays