Cobol/Assembler Dinosaur here taking Java. (first post - Hello All)
I'm trying to tell if the user has input any text. My own feeble effort below:
How do I do this ? Hope this enough info. thanks
[code=java]
string sandname;
boolean done = false;
.....
try
{
while (!done)
{
sandname = " ";
sandname = sandwichField.g etText();
if (sandname != " ")
done = true;
else
throw new NumberFormatExc eption();
}
...
catch(NumberFor matException e)
{
promptLabel.set Text("Enter a sandwich name.");
hiddenBox.setSt ate(true);
sandwichField.s etText("");
sandwichField.r equestFocus();
}[/code]
I'm trying to tell if the user has input any text. My own feeble effort below:
How do I do this ? Hope this enough info. thanks
[code=java]
string sandname;
boolean done = false;
.....
try
{
while (!done)
{
sandname = " ";
sandname = sandwichField.g etText();
if (sandname != " ")
done = true;
else
throw new NumberFormatExc eption();
}
...
catch(NumberFor matException e)
{
promptLabel.set Text("Enter a sandwich name.");
hiddenBox.setSt ate(true);
sandwichField.s etText("");
sandwichField.r equestFocus();
}[/code]
Comment