if (selectedRow == -1) {
JOptionPane.showMessageDialog(rootPane, "You must chose one membership type first!", "Error!", JOptionPane.ERROR_MESSAGE);
} else {
int id = (int) tblMembership.getModel().getValueAt(selectedRow, 0);
DataMembership dataMembership = new DataMembership();
MembershipTypeBean bean = dataMembership.getTypeByID(id);
txtTypeName.setText(bean.getTypeName());
txtMainDuty.setText(bean.getMain_Duty());
spinFee.setValue(bean.getFee());
spinMinAttendance.setValue(bean.getMin_Attendance());
spinDiscount.setValue(bean.getDiscount());
txtHiddenID.setText(String.valueOf(bean.getMembershipTypeID()));
panelForm.setVisible(true);
this.setSize(this.getWidth(), 450);
actionFlag = "Update";
}
}//GEN-LAST:event_btn_UpdateActionPerformed