Coding calculate
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
float bayaranPerbulan=Float.parseFloat(bayaranPerbulanField.getText());
float jumlahBulan=Float.parseFloat(jumlahBulanField.getText());
float totalPembayaran=bayaranPerbulan*jumlahBulan;
totalPembayaranField.setText(""+totalPembayaran);
}
Coding delete
private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {
int[] selected = masterTable.getSelectedRows();
List<dtmahasiswa.Datamahasiswa2> toRemove = new ArrayList<dtmahasiswa.Datamahasiswa2>(selected.length);
for (int idx = 0; idx < selected.length; idx++) {
dtmahasiswa.Datamahasiswa2 d = list.get(masterTable.convertRowIndexToModel(selected[idx]));
toRemove.add(d);
entityManager.remove(d);
}
list.removeAll(toRemove);
Coding close
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0); // TODO add your handling code here:
Coding new
private void newButtonActionPerformed(java.awt.event.ActionEvent evt) {
dtmahasiswa.Datamahasiswa2 d = new dtmahasiswa.Datamahasiswa2();
entityManager.persist(d);
list.add(d);
int row = list.size() - 1;
masterTable.setRowSelectionInterval(row, row);
masterTable.scrollRectToVisible(masterTable.getCellRect(row, 0, true))