java - How to get the JOptionPane.showOptionDialog in the same monitor? -


i have working laptop 2 monitors connected it. run application on monitor 2 (which external monitor).

in application calling joptionpane.showoptiondialog, problem dialog box appear on monitor 1 (which laptop screen) in spite of running , doing computation on application in monitor two.

i tried getparent() method nothing worked, want pop jpanel through called.

here sample of joptionpane.showoptiondialog:

joptionpane.showoptiondialog(getparent() ,                 jsr, //object                 "messages",                 joptionpane.yes_no_option,                 joptionpane.error_message,                 null,                 options,                 options[0]);    scrollpane.setviewportview(textarea);    validate();    repaint(); 

this annoying sometime thought application crashed there nothing in monitor 1 there dialog window poped in monitor one.

edit:

this new question, dont have problem in bringing dialog box on top, have used solution of getparent() method did not work. main problem of monitors, if running application monitor-2 should displayed in monitor-2. not happening in case.

is there other way deal problem? or can justify problem? thanks

try joptionpane.showmessagedialog(this, "testing");, according this should help.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -