You are on page 1of 2

private void btnprocesarActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: String sb; sb=txtsb.

getText(); //consigue el dato de la caja double ssb=Double.parseDouble(sb); String faltas; faltas=txtf.getText(); //consigue el dato de la caja double ffaltas=Double.parseDouble(faltas); //Calcular el descuento double d; d=ssb/30*2*ffaltas; double np; np=ssb-d; //Convertirlo a String para mostrarlo txtd.setText(String.valueOf(d)); txtnp.setText(String.valueOf(np)); } private void btncerrarActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: dispose(); } private void btnlimpiarActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: txtsb.setText(""); txtf.setText(""); txtd.setText(""); txtnp.setText(""); txtsb.requestFocus(); }

You might also like