Java Swing — Asking for User Input (and creating a blocking thread) by popping up a JFrame

前端 未结 2 1169
傲寒
傲寒 2021-01-25 01:29

My top-level container is MainFrame (JFrame). I want to be able to popup another JFrame with a JPanel that has two JTextFields from MainFrame.

相关标签:
2条回答
  • 2021-01-25 02:18

    Use a JDialog

    You can set it to be modal in this JDialog(Frame, modal) constructor

    0 讨论(0)
  • 2021-01-25 02:26

    Look into JDialog

    You can extend JDialog and call super in your constructor with the second parameter set to true

    
    super(parent, true);   
    
    
    0 讨论(0)
提交回复
热议问题