#OnAction Tag I Put On Sense Give Error In Intellj?

48 messages · Page 1 of 1 (latest)

hard kilnBOT
#

This post has been reserved for your question.

Hey @marsh pond! 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.

#

<@&765578700724371486>

Requested by The Blue Sky#5617
jaunty yarrow
#

Can you show the errors?

lone willow
#

literally the first result

jaunty yarrow
#

Can you show your controller class?

jaunty yarrow
lone willow
#

it's the same error, you have to try and apply the solution you find to your code, it's not gonna be exactly the same code

lone willow
jaunty yarrow
#

and the accepted answer seems ok as well

#

Can you also show the Main.fxml file?

lone willow
#

what does it say when you hover over the error?

jaunty yarrow
#

maybe try using welcomeMessage

#

with a lowercase w

#

both in the method name and in the FXML

#

oh lol

#

fx:controller="com.example.countrygame.Main"

#

that's the problem

jaunty yarrow
#

fx:controller should refer to the controller class

#

oh and you might want to follow conventions

#

like ClassesArePascalCase and methodsAndFieldsAreCamelCase

#

You are using SceneBuilder for JavaFX 19 while using JavaFX 17

#

You can either ignore the error or use an older Scene Builder version (for Java 17) or use JavaFX 19 in your project

jaunty yarrow
#

it needs to be a URL pointing to an image

#

this could be from some server but also on the local system

#

or part of the program (in the resource folder)

jaunty yarrow
#

?

#

What do you mean with showing normal?

#

you mean it doesn't include the background image?

#

well maybe the URL isn't valid

#

What did you enter as the URL?

#

oh right

#

Where is the file located? Is the path correct?

#

and how is the style.css file declared in the FXML?

#

yeah ..\..\..\.. is not really a good idea

#

Where is the FXML file?

#

and where is the css file?

#

images and css files are resources as well

#

so they should be in the resources directory

#

and you need to update the path of course

#

Can you show the style.css again?

#

oh ok

#

and when starting the Java program?