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

前端 未结 2 1168
傲寒
傲寒 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:26

    Look into JDialog

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

    
    super(parent, true);   
    
    

提交回复
热议问题