It's a Processing question not an Arduino one, so you're asking in the wrong place. However, that logic looks horrible. In the second loop inside draw() you will spin waiting for Data[ m ] to become non-null, but there is nothing writing to it so that will never happen. Draw() will sit in the first loop until it manages to empty the serial buffer, drop into the second loop and stay there until you kill the program. Your program is not able to respond to key presses because it is stuck in Draw().
Suggest you change the structure to something like this (untested):
// handle input port and output file, giving priority to the input port
if( myPort.available () > 0 )
{
myData = myPort.readStringUntil('\n');
if ( myData != null )
{
Data[n] = myData;
n++;
}
}
else
{
if(m < n)
{
if ( Data[m] != null)
{
output.print(Data[m]);
m++;
}
}
}
I'd prefer to see Data structured as a circular buffer and array bounds checking, but as long as your Processing application never needs to deal with more lines than the size of your Data array in any given execution then something along the lines given above should work.