need help! assignment due by tmr!

Hi. I need help for this program.

import javax.swing.JOptionPane;

public class Homework3

{

public static void main(String args[]){

int number;

String message1 = "Please enter the positive number"+ "\n";

String message2 = "Please enter the positive number, not negative number"+ "\n";

String message3 = "Please enter in numbers, not letters"+ "\n";

String num, outputMessage ;

try{

num = JOptionPane.showInputDialog(message1);

number = Integer.parseInt(num);

if (number<0)

throw new IllegalArgumentException();

outputMessage = "The number was"+ number ;

JOptionPane.showMessageDialog(null,outputMessage);

}

catch( NumberFormatException e)

{

JOptionPane.showMessageDialog(null,message3);

}

catch ( IllegalArgumentException e)

{

JOptionPane.showMessageDialog(null,message2);

}

System.exit(0);

}

}

So far its working but I want the Input to arrange in positive integer in range of 0 to 9999. It accepts the 4 digits of positive integer. and also once I put the positive integer in Input, the output has to be showing in this way.

The number was 1234

The digits are

1

2

3

4

How to write this program? please help me!!!!!!!