Java swing. How to wait for other Jframes

In JFrame, when I click "login", I output another Jframe, which is the login window.

How to make my main Jframe wait for my Jframe login before doing anything else?

+3
source share
3 answers

Just use a modal dialog instead of a frame, so you cannot do anything until it is closed

see http://mindprod.com/jgloss/modal.html for an explanation and see http://www.java2s.com/Tutorial/Java/0240__Swing/ASimpleModalDialog.htm for sample code

JFrame, . , .

+5

, , , :

JFrame JFrame?

, - .

  • "" "" .
  • "" ,
    • , . ActionListener
    • , , . actionPerformed, , , , "" .

, , .

+2

Use a JModalFrame instead of a JFrame.

0
source

Source: https://habr.com/ru/post/1724158/


All Articles