Java swing How to wait for other jframes

In JFrame, when I click "login", I pop up another JFrame, namely login window

How can I make my main JFrame wait for my login JFrame to exit before doing anything else?

Solution

Just use the modal dialog instead of the frame, so you can't do anything else until you close it

see also http://mindprod.com/jgloss/modal.html For explanation and see http://www.java2s.com/Tutorial/Java/0240__Swing/ASimpleModalDialog.htm Code example

If you insist on using JFrame, you can use the solution by covering another frame with a glass frame Not a very good solution, I admit

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>