dkim18
asked on
File menu and Exit: Invoking closing the window
I am working on java applet and trying to implement the following.
The top-level window has a File menu containing a menu item "Exit". When "Exit" is invoked the application will close the window (the user sees an empty applet page with just the title and header)
I did implement the appearance file menu and exit option, but does nothing.)
How do I implement the above "Exit" behavior?
Thank you for help
The top-level window has a File menu containing a menu item "Exit". When "Exit" is invoked the application will close the window (the user sees an empty applet page with just the title and header)
I did implement the appearance file menu and exit option, but does nothing.)
How do I implement the above "Exit" behavior?
Thank you for help
Use showDocument() to load a new empty page.
ASKER
It is not Frame, but JApplet
then use showDocument:
applet.getContext().showDo cument(url );
applet.getContext().showDo
What is
>>The top-level window
then?
>>The top-level window
then?
Or if you don't want to switch page for some reason then remove the content from your applets root pane.
Have you got an applet inside a frame? What is the relationship between application/applet or frame/applet?
ASKER
Please refer below site to all your questions. It is going to be better than my explnation.
There is a sample picture for this applet, so you can get better understanding.
http://webdev.apl.jhu.edu/%7Emed/fall03/homework/04LibrarySwing.html
There is a sample picture for this applet, so you can get better understanding.
http://webdev.apl.jhu.edu/%7Emed/fall03/homework/04LibrarySwing.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
frame.dispose();
Remember, you can't do System.exit in an applet