Java Reference
In-Depth Information
Window.alert("Not a valid number.");
}
}
};
private void totalRow() {
double rowTotal = 0.00;
for (int cell = 3;cell<=9; cell++) {
TextBox timeWidget = (TextBox)
flexEntryTable.getWidget(currentRow, cell);
double t = Double.parseDouble(timeWidget.getValue());
rowTotal = rowTotal + t;
}
flexEntryTable.setWidget(currentRow, 10, new
Label(NumberFormat.getFormat(".00").format(rowTotal)));
totalGrid();
}
private void totalGrid() {
double grandTotal = 0.00;
for (int row=1;row<flexEntryTable.getRowCount();row++) {
Label rowTotalWidget = (Label)
flexEntryTable.getWidget(row, 10);
double rowTotal =
Double.parseDouble(rowTotalWidget.getText());
grandTotal = grandTotal + rowTotal;
}
;
totalLabel.setText(NumberFormat.getFormat(".00").format(grandTotal));
}
private Date addDays(Date d, int numberOfDays) {
int day = d.getDate();
int month = d.getMonth();
int year = d.getYear();
return new Date(year, month, day+numberOfDays);
}
private String formatDate(Date d) {
120
Search WWH ::




Custom Search