1

I work on a java application. Now if I run the application on my main screen and drag it to the extended screen , the application will run on the extended screen but any popups (error msg popups or option popups ) come on the main screen.

I basically want the application and the popups to come on the same screen whether I am running the application on the main screen or I have dragged it to the extended screen.

How do I get the optionpane popups to appear on the extended screen if the application is being dragged to the extended screen.

I have tried Show JFrame in a specific screen in dual monitor configuration but the popups still come on the wrong screen.

Community
  • 1
  • 1
  • How are you opening your pop-ups, show some code please. – Sanjeev Aug 05 '14 at 09:36
  • "the first parameter is parentComponent: Defines the Component that is to be the parent of this dialog box. It is used in two ways: the Frame that contains it is used as the Frame parent for the dialog box, and its screen coordinates are used in the placement of the dialog box. In general, the dialog box is placed just below the component. This parameter may be null, in which case a default Frame is used as the parent, and the dialog will be centered on the screen (depending on the L&F)." http://stackoverflow.com/questions/8144018/how-to-set-position-of-joptionpane – Thusitha Thilina Dayaratne Aug 05 '14 at 09:43
  • @Sanjeev : Just to give an example of the issue that I am facing.. In the main function, I am creating an instance of the application.. and once the application opens I throw up a popup asking the user to terms and condtions and press ok to run the application.. x = JOptionPane.showOptionDialog(appl.Frame, "ABCDEF", "XYZ", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); where appl.Frame is the application window. – blistering barnacles Aug 05 '14 at 09:52
  • possible duplicate of [java, show JFrame in a specific screen in dual monitor configuration](http://stackoverflow.com/questions/4627553/java-show-jframe-in-a-specific-screen-in-dual-monitor-configuration) – DavidPostill Aug 05 '14 at 09:52
  • @ThusithaThilinaDayaratne : Il go through the link, thanks.. but is the way I have used JOPtionPane correct here or do I need to include some parameters for the positioning.Thanks.. – blistering barnacles Aug 05 '14 at 09:53
  • @DavidPostill : I have tried that as well.That helps me run the application on the extended screen directly but the optionpane popups still come on the main screen. – blistering barnacles Aug 05 '14 at 10:25

0 Answers0