I have modified your original code using the example I gave above. You can see the changes in bold.
This should solve your problem
package test;
//Payroll1.java
//Payroll1 that displays calculates weekly pay for an employee
import java.util.Scanner; // program uses class Scanner
public class Payroll1
{
// main method begins execution of Java application
public static void main( String args[] )
{
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
String name; // employees name
int payrate; // employees hourly rate
int hours; // hours employee worked for the week
int product; // product of payrate and hours
System.out.print( "Enter Employee's name: , enter stop to end." ); // prompt
[B]while (input.hasNext())[/B]
{
name = input.next(); // read name from user
[B]if (name.equals("stop")) {
System.exit(0);
}[/B]
System.out.print( "Enter payrate: " ); // prompt
payrate = input.nextInt(); // read hourly rate from user
while ( payrate <= 0 )
{
System.out.print( "Payrate must be a positive number, try again: $" );
payrate = input.nextInt();
}
System.out.print( "Enter hours worked: " ); // prompt
hours = input.nextInt(); // read hours worked from user
while ( hours <= 0 )
{
System.out.print( "Hours must be a positive number, try again: " );
hours = input.nextInt();
}
product = payrate * hours; // multiply payrate times hours worked
System.out.printf( "Employee Name: %s, Weekly pay is $%d%n", name, product );
[B]System.out.print( "Enter Employee's name: , enter stop to end." ); // prompt[/B]
} // end while
} // end method main
} // end class Payroll1