Friday, April 13, 2007

Action Button

public boolean action(Event evt, Object obj)
{
boolean retval = false; // assume not processed
if ("New".equals(obj))
{
if (validateFields())
{
try
{
CurrentOperator.insert(db);
readOperators();
}
catch(ComException e)
{
setStatus(e);
}
}
retval = true;
}
else if ("Update".equals(obj))
{
if (validateFields())
{
try
{
CurrentOperator.update(db);
readOperators();
}
catch(Exception e)
{
setStatus("DB Error: " + e.getMessage());
}
}
retval = true;
}
return retval;
}
If the New button is pressed, the fields are validated and

No comments: