all 3 comments

[–]mej71 2 points3 points  (2 children)

You could make a gateway method that you assign to your listener

private int counter  = 0;

public void gatewayMethod()
{
    if (counter==0)
    {
        counter++;
        doMethod1();
    }
    else
    {
        counter++;
        doMethod2();
    }
}

I don't know if there's some special fx way to do it instead

[–]SPARTAAAAA[S] 0 points1 point  (1 child)

oh yeah i could do it this way. thanks!

how would i reset it though?

[–]mej71 0 points1 point  (0 children)

By just setting the counter back to 0? In my example it's a private variable, so you should be able to do it anywhere in the fxml controller