Changing interectOnClick after .build call

Anyone know if this is possible and how to do it? My attempts thus far have been unsuccessful.

Since there’s no code I don’t know how you’re trying to do this, but the way I do it with XML is like this. IMO it should work, but I don’t use .build except for 1 rare case so I might be wrong.

That piece of code will change a button (Generate Galaxy) to something else (Resume Game) and it’s associated method. Hopefully that’ll work for you.


if (gState.isGameRunning()) {

// change the onClick method and the name of the New Galaxy

NiftyMethodInvoker onClickMethod = new NiftyMethodInvoker(


“resumeGame()”, //NOI18N


screen.findElementByName(“mnuGenGalaxy”).getElementInteraction().getPrimary().setOnClickMethod(onClickMethod); //NOI18N




Thanks, you!