#because "this.fieldname" is null

17 messages · Page 1 of 1 (latest)

wanton phoenixBOT
#

This post has been reserved for your question.

Hey @pale hornet! Please use /close or the Close Post button 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.

signal lynx
#

can we have...more details

pale hornet
#

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)

signal lynx
#

i meant the code, so we can figure out why fieldname is null

pale hornet
#

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

signal lynx
#

fieldname is never intiialised (new JTextField())

pale hornet
#

ok how can i initialize ?

signal lynx
#

i showed in my message

signal chasm
#

We all know it was a trap. good thing he didn't trust you and just did new JTextField()

pale hornet
#

im new