Need to read input of two JTextfields after a button is clicked

前端 未结 2 1713
无人及你
无人及你 2021-01-16 08:58

I\'m working on a program that launches an applet that will demonstrate how the Extended-Euclid algorithm performs. I have two JTextFields that values will be entered in and

2条回答
  •  悲&欢浪女
    2021-01-16 09:51

    I'm getting a NullPointerException at the line where I set nText = nField.getText();

    That probably because you defined nField as both a class variable and a local variable. The problem is that you are trying to reference the class variable which is null.

    The solution is to get rid of the class variable.

提交回复
热议问题