#OnAction Tag I Put On Sense Give Error In Intellj?
48 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @marsh pond! 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.
<@&765578700724371486>
Can you show the errors?
Can you show your controller class?
that post has two deleted "answers" from the same user that actually aren't answers lol
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
ah my bad, i didn't read the post lmao
No, the post itself is fine
and the accepted answer seems ok as well
Can you also show the Main.fxml file?
well i mean, i didn't read any of it
what does it say when you hover over the error?
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
replace this with fx:controller="com.example.countrygame.action"
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
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)
?
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?