public double getStringToDouble(String x){
return Double.parseDouble(valorMod);
}
public String getDoubleToString(double x){
cadena = String.valueOf(valorMod);
return cadena;
}
With those methods I transform from String to Double, to make a calculator
private void resta1ActionPerformed(java.awt.event.ActionEvent evt) {
if(turno==1){
double res= m.getStringToDouble(o.getValor1());
double cos = Math.cos(res);
txtvista.setText(m.getDoubleToString(cos));
}
}
With that button you should show me in the jtextfield the calculation