CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Guest

    applet window close

    Hi,
    Hi, friends:
    I am new to java.
    I have quit button in an applet. Can somebody tell me what method can be used to close an applet window if quit button press?

    thanks in advance!


  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: applet window close

    If the window is a Frame, call 'dispose()'.

    --
    Jason Teagle
    [email protected]

  3. #3
    Guest

    Re: applet window close

    Hi,Jason:
    The window is applet window not in the frame.




  4. #4
    Guest

    Re: applet window close

    Hi, Jason:

    My project is applet window not in the frame.


  5. #5
    Join Date
    Sep 1999
    Location
    Madurai , TamilNadu , INDIA
    Posts
    1,024

    Re: applet window close


    If you are running ur applet using applet viewer , then you can close the
    applet viewer window. But if you run it inside a browser , you cant do it in pure java.
    check out http://www.nevaobject.com/java/index.htm

    If you use appletViewer :



    Component c = applet;
    while( ( c != null ) && !( c instanceof Frame )) c = c.getParent();

    if( (c != null )&& (c instanceof Frame ) ){
    applet.stop();
    applet.destroy(); // I dont know whether these two lines are necessary.
    ((Frame) c ).hide();
    ((Frame) c ).dispose();
    }





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