Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以,我正在制作一个计算集水量的程序。而且我有 2 个文本区域(JFrame),我需要将它们转换为双精度,所以,基本上我想这样做!
double a = textarea1; double b = textarea2; // textarea1 and textarea2 are JTextArea's double c = a * b * 0.0632
如何转换JTextArea为双精度或如何制作与用户输入的值相同的双精度JTextArea?
JTextArea
我认为你需要这个:-
double a = Double.parseDouble(textarea1.getText());