already done the TIO one as follows:
do
{ dStr=JOptionPane.showInputDialog("Please enter "+name+"'s demand:");
d=console.nextInt();
if (d<0)
System.out.println("Demand can't be negative.");
}while(d<0);
but don't know how to transfer it into GUI style?
anyone can help me? Thx!!!!
Get a good book which shows you how to do the basics of creating and listening to user input with GUI's.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439