You are on page 1of 2

public ACTIVIDAD_03() {

initComponents();

setSize(500,300);

setLocationRelativeTo(null);

private void btnCalcularActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

double peso=Double.parseDouble(txtPeso.getText());

double altura=Double.parseDouble(txt.getText());

double imc;

Math.pow(altura, 2);

imc=peso/altura;

txtImc.setText(String.valueOf(imc));

private void btnLimpiarActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

txtPeso.setText("");

txt.setText("");

txtImc.setText("");

txtPeso.requestFocus();

private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

dispose();

}
private void btnCalcularActionPerformed(java.awt.event.ActionEvent evt) {

double x1=0,x2=0,y1=0,y2=0,distancia=0; x1=Double.parseDouble(txtX1.getText());


y1=Double.parseDouble(txtY1.getText()); x2=Double.parseDouble(txtX2.getText());
y2=Double.parseDouble(txtY2.getText()); distancia=(Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)));
txtDistancia.setText(String.valueOf(distancia)); }

You might also like