import javax.swing.JOptionPane;


public class DeterminaMax {

	public static void main(String[] args) {
		
		boolean continua=true;
		int max=0;
		
		while(continua)
		{
			String valore=JOptionPane.showInputDialog("Inserisci un numero");
			
			int numero=Integer.parseInt(valore);
			
			if(numero<0)
			{
				continua=false;
			}
			else
			{
				if(numero>max)
				{
					max=numero;
				}
							
			}
		}
		JOptionPane.showMessageDialog(null, "Il massimo numero letto è "+max);
	}
}
