代号一-在NetBeans上使用Java编码进行编码时,使用GUI(代号一设计器)从文本区域获取值 [英] Codename one - get value from text area using GUI(codename one designer) while coding using java coding on NetBeans
本文介绍了代号一-在NetBeans上使用Java编码进行编码时,使用GUI(代号一设计器)从文本区域获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
由于某种原因,我无法从名为"txtNum1"和"txtNum2"的文本区域中获取值,因此正在使用"txtNum1.getText()"& "txtNum2.getText()"它什至无法识别"txtNum1",我使用了GUI构建器.我在做错什么吗?
For some reason I can't fetch value from a Text area called "txtNum1" and "txtNum2", am using "txtNum1.getText()" & "txtNum2.getText()" it can't even recognize "txtNum1" I used the GUI builder. Am I doing something wrong?
protected void onMain_BtnAction(Component c, ActionEvent event) {
String num1 = txtNum1.getText();
String num2 = txtNum2.getText();
calc(Integer.parseInt(num1),Integer.parseInt(num2));
}
推荐答案
使用:
String num1 = findTextNum1(c).getText();
这篇关于代号一-在NetBeans上使用Java编码进行编码时,使用GUI(代号一设计器)从文本区域获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文