I am just starting out with Monkeybars. I want to create modal dialog
boxes, though only simple ones (eg confirm to quit). Java already has
this done with JOptionPane, but I cannot get it to be modal.
I have my event handler in the controller, which calls
showConfirmDialog, say like this (which is not going to actually do
anything with the result, but this is just to illustrate):
“Do you really want to quit?”,
This works fine, displaying the dialog, but it is not modal. I think the
problem is that the first parameter is nil. It needs the parent
My problem here is two-fold. Firstly the Ruby type has to become a Java
type. I think JRuby may be able to do that on its own. The big problem
is that I see to have to access to the parent component, the JFrame,
from its own controller (and this seems to be by design; the view and
the controller are separated as far as possible).
So is there a way around this? Any help appreciated.