model.remove(parcelTable.getSelectedRow());
}
else if(obj == addButton)
{
int num;
Parcel parcel = Utility.create(Parcel.class);
num = Utility.parseInteger(shipmentId.getText().trim());
if(num<=-1)
{
shipmentId.requestFocusInWindow();
return;
}
parcel.setShipmentId(num);
parcel.setContents(contents.getText().trim());
//Width
num = Utility.parseInteger(width.getText().trim());
if(num<=-1)
{
width.requestFocusInWindow();
return;
}
parcel.setWidth(num);
num = Utility.parseInteger(height.getText().trim());
if(num<=-1)
{
height.requestFocusInWindow();
return;
}
parcel.setHeight(num);
num = Utility.parseInteger(length.getText().trim());
if(num<=-1)
{
length.requestFocusInWindow();
return;
}
parcel.setLength(num);
num = Utility.parseInteger(weight.getText().trim());
if(num<=-1)
{
weight.requestFocusInWindow();
return;
}
parcel.setWeight(num);
parcel.setParcelStatus(ParcelStatus.PARCEL_RECEIVED);
model.add(parcel);
clear();
}