how to show JOptionPane on the top of all windows

前端 未结 6 1011
予麋鹿
予麋鹿 2021-01-07 21:01

I have created a DialogUtil which shows numbers of JOptionPan in different situation. sometimes in my action class call to this method with null parameters as below.

6条回答
  •  轮回少年
    2021-01-07 21:42

    I don't know what WebOptionPane or WebPanel are, but if they're based on JOptionPane, then the issue is that you're passing null for that first argument to the showXXX() method. If you want the JOptionPane to be modal -- which forces it to be in front of a specified window -- then you need to specify a window (i.e., a JFrame -- for that first argument.

提交回复
热议问题