Code:
import javax.swing.JOptionPane;
public class Main {
public static void main (String [] args) {
int bank = 1000;
int bet;
JOptionPane.showMessageDialog(null, "You can bet between 1 and " + bank);
do
{
bet = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter your bet:"));
} while (bet <= 0)|| (bet > bank);
JOptionPane.showMessageDialog(null, "Your money's good here");
}
}
Also, what does a Scanner class have anything to do with it?