#because "this.fieldname" is null
17 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @pale hornet! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
can we have...more details
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "javax.swing.JTextField.getText()" because "this.fieldname" is null
at Dns.dnsTriggerd(Dns.java:28)
at Layout$1.actionPerformed(Layout.java:63)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2314)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:407)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
i meant the code, so we can figure out why fieldname is null
dns.java
layout.java
i just want to be able to access the function from the actionlistiner
in another file
to not clutter all the layout file
fieldname is never intiialised (new JTextField())
ok how can i initialize ?
i showed in my message
We all know it was a trap. good thing he didn't trust you and just did new JTextField()
im new