#Need Help with an assignment in JAVA

1 messages · Page 1 of 1 (latest)

midnight eagle
#

I have an assignment that is due soon and I am having trouble identifying the problem of this code

stone ravineBOT
#

<@&987246399047479336> please have a look, thanks.

stone ravineBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

midnight eagle
#

the error that keeps on showing

honest sorrel
#

the bug is that u add ur buttons before u actually created the buttons

#

so at the moment of adding, they are all still null

#

before u add the buttons, u have to create them first (btnAdd = new...)

#

otherwise ur essentially just doing
...add(null)

#

which makes no sense, hence crash

#

so change the order

midnight eagle
#

ok got it now thank you very much! You are such a big help thank you