Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+10 votes

I am trying to add the HBox and change to Pane to a BorderPane and when I try to run it I get a message saying "java.lang.reflect.InvocationTargetException" and I can't seem to fix it. Does anyone possibly know why this is happening?

asked in CSC305 Fall 2023 by (1 point)

1 Answer

+2 votes

Hmm, that's not a very informative error message, is it?

Any chance that one of your objects is null, from not having been initialized to a value?

Or, perhaps you can show us a few lines of code where you think the problem may be?

answered by (3.5k points)
+1

That helped, it seems that I put the wrong variable in the .setCenter().

...