I want to update my answer, because I realize that you can actually put a parameter into a method call from a button. If you want to have different functionality from the same button, but have it do different things due to some outside variable, then you can pass in that value when you are setting the onAction for the button.
So for example, I have a "startSim" button, but it needs a couple of parameters to start the sim, so when I set the onAction method for the button, I passed in the value from one of our sliders as a parameter of the method. so the code looks something like, button.onAction(evt -> startSim(slider.getValue());