Daniel,
It
is possible to do this without using a
JFrame and reading the bill amount using
JOptionPane can be done with about the same amount of code that it would take using
Scanner.
Take a look at the documentation on JOptionPane, specifically
showInputDialog() and then experiment with it. I should add, too, that although the documentation doesn't say it, you can (and in this case should) specify
null for the
parentComponent parameter.