我是第一次练习JAVA的学生.我们被要求创建一个简单的计算器.我做了一切没有任何错误.我的唯一问题是,当我以1.66 + 55为例,甚至5 + 6时,它会显示标题中的错误.这是同志
import java.awt.BorderLayout;
Run Code Online (Sandbox Code Playgroud)
公共类Frame2扩展JFrame {
private JPanel contentPane;
private JTextField tot;
public String operateur = "";
public String s;
public String Value = "";
public String Value2 = "";
public Double Total = 0.0;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Frame2 frame = new Frame2();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame. …Run Code Online (Sandbox Code Playgroud)