문제

I am tring to Hide a JFrame when a JDialog box opened, please how doi do this usuing the addActionListener();

도움이 되었습니까?

해결책

When you create a JDialog you should be specifying the JFrame as the owner of the dialog, then you can use the getOwner() method of the dialog to get the frame reference at any time.

In you JDialog you should be able to use a WindowListener.

  1. In the windowOpened event you hide the frame
  2. in the windowClosed event you show the frame.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top