Código PHP:
package isreiva;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.util.Scanner;
public class Calculo extends JFrame {
private JButton jButton1 = new JButton();
private JLabel jLabel1 = new JLabel();
private JTextField jTextField1 = new JTextField();
private JLabel jLabel2 = new JLabel();
public Calculo() {
try {
jbInit();
} catch (Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.getContentPane().setLayout( null );
this.setSize( new Dimension(400, 300) );
jButton1.setText("Calcular");
jButton1.setBounds(new Rectangle(265, 190, 110, 40));
jButton1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
jLabel1.setText("Escriba sus honorarios en el campo: ");
jLabel1.setBounds(new Rectangle(65, 20, 180, 40));
jTextField1.setBounds(new Rectangle(100, 65, 115, 30));
jLabel2.setText("");
jLabel2.setBounds(new Rectangle(125, 115, 105, 35));
this.getContentPane().add(jLabel2, null);
this.getContentPane().add(jTextField1, null);
this.getContentPane().add(jLabel1, null);
this.getContentPane().add(jButton1, null);
}
private void jButton1_actionPerformed(ActionEvent e) {
double Honorarios,Subtotal,IVA,ISR,RIVA,Total;
jTextField1.write(Honorarios);// aqui tengo un problema de tipo de dato incompatible
IVA = Honorarios*.16;
Subtotal = Honorarios + IVA;
ISR = Honorarios * .1;
RIVA = IVA * (2/3);
Total = Subtotal - (ISR+RIVA);
}