CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    3

    How do you stop a window frame from closing



    Hi,

    I am new to Java (Been doing C++ and VC++ for years though!), just started using VCafe 3.0.

    I am trying to find a way to prevent a window from closing.

    When I trap a "WindowClosing" message in WindowEvent, how do I stop it from getting further up to the UI chain and prevent the window closing?

    Thank.



  2. #2
    Join Date
    May 1999
    Posts
    93

    Re: How do you stop a window frame from closing



    After creating the frame call the function


    frame.setDefaultCloseOperation( JFrame.DO_NOTHING_ON_CLOSE );



  3. #3
    Join Date
    Apr 1999
    Posts
    19

    Re: How do you stop a window frame from closing





    After having trapped the "WindowClosing" message in WindowEvent just consume it

    using consume method of .. I think of Event Class.

  4. #4
    Join Date
    May 1999
    Posts
    93

    Re: How do you stop a window frame from closing



    Actually this won't work. Swing does not check whether the event is consumed

    but instead only looks at the 'closeoperation' flag.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured