java - How to stop JOptionPane from disabling root frame -
how show joptionpane without disabling open frames?
i have jframe start , stop button. @ point, want user able press 'stop' button on main frame, stop secondary thread (which started start button).
however second running thread opens joptionpane. when so, main frame disabled, , user can't press stop button.
(and when opens multiple of these joptionpanes in row, becomes immensely frustrating trying stop it).
i've tried
joptionpane.showmessagedialog(null, "it's broken mate"); with no success. tried passing jframe disable:
joptionpane.showmessagedialog(new jframe(), "still no go"); that failed too. tried
jframe frame = new jframe(); frame.setvisible(true); joptionpane.showmessagedialog(frame, "cmon please"); and furthermore,
jframe frame = new jframe(); frame.setvisible(true); joptionpane.setrootframe(frame); joptionpane.showmessagedialog(frame, "i'm getting angry now."); and still. nothing. not work. opens message box, , disabled. have dismiss joptionpane before becomes enabled again...
any ideas?
cheers
joptionpanes modal, can't directly.
all dialogs modal. each showxxxdialog method blocks caller until user's interaction complete.
you'll have use jdialog or similar.
joptionpane p = new joptionpane("i'm getting happy now."); jdialog k = p.createdialog(":-)"); k.setmodal(false); // makes dialog not modal k.setvisible(true);
Comments
Post a Comment