how to display all ouput using pop up dialog boxes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jean Miles

    how to display all ouput using pop up dialog boxes

    I'd like the output from this code to be show in a popup dialog box.

    Code:
    import javax.swing.JOptionPane;    
    import java.lang.String;
    
    
    public class displayAPoem1    
    {
    
    public static void main(String[] args){  
            
    int month = 0;
    int number;
    month = number; 
    JOptionPane.showMessageDialog(null, phrase);
    
    		switch(month)   //start switch
    		{
    		case 1: case 3:  case 5: case 7: case 8: case 10: case 12:
    			System.out.println("All the rest have thirty-one,");
    			break;
    			case 2:
    			System.out.println("Thirty days hath September,");
    			System.out.println("April, June and November.");
    			System.out.println("All the rest have thirty-one,");
    			System.out.println("with February's 28 to make it fun.");
    			System.out.println("Leap year happening once in four,");
    			System.out.println("Gives Feburary one day more. ");
    			break;
    			case 4: case 6:case 11:
    			System.out.println("April, June and November.");
    			break;
    			case 9:
    			System.out.println("Thirty days path September");
    			break;
    		}
    }
    }
Working...