Hi Paul,
if you do not insist on two input fields, you might want to use this solution: prompt the user to enter both the gallons and the miles into the single input field with a separator between the both values (a blank character will do). Then let a java.util.StringTokenizer object parse the input string appropriately. This will do (although the custom dialog you mentionend would be a more elegant solution

).
And here's the code snippet:
String input = JOptionPane.showInputDialog("Enter <gallons>/<miles> (leave field empty to quit):" );
// check for quitting condition
if (input.length() == 0)
System.exit(0);
StringTokenizer st = new StringTokenizer(input, " /,|"); // allow for several separators
if (st.hasMoreElements())
inputGallons = (String)st.nextElement();
if (st.hasMoreElements())
inputMiles = (String)st.nextElement();
// handle possible errors (miles missing, wrong separator...)
Just don't forget to
import java.util.StringTokenizer;
Regards and have fun with Java,
Manfred