#Java - Button and User Events

1 messages · Page 1 of 1 (latest)

echo mason
#

/help I am trying to create a dice game in which the user enters a number then clicks a button which outputs a random number. When the program runs, there shouldn't be a number yet, only when the user clicks the button should a random number appear. The user guesses what the random number will be. Though, the operations I want are not going through when the button is clicked. I tried the 'if(event.getSource()==button)' thing so that when the user clicks the button, the operation within the curly brackets after the if statement will go through. Yet, I'm only getting more errors. I initially used this video for help: https://www.youtube.com/watch?v=S_JN7zO12H4 I desperately need help with this. This is how my code looks : https://replit.com/join/qvqgsstadz-mariamabrams . You may edit this code.

small skiffBOT
#

Hey, @echo mason!
Please remember to /close this post once your question has been answered!

ebon igloo
echo mason
#

button.setOnAction()