?
Solved

File menu and Exit: Invoking closing the window

Posted on 2003-11-25
10
Medium Priority
?
281 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9817650
If it's a JFrame or Frame, just do

frame.dispose();

Remember, you can't do System.exit in an applet
0
 
LVL 92

Expert Comment

by:objects
ID: 9820562
Use showDocument() to load a new empty page.
0
 

Author Comment

by:dkim18
ID: 9828698
It is not Frame, but JApplet
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 92

Expert Comment

by:objects
ID: 9828721
then use showDocument:

applet.getContext().showDocument(url);
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9828756
What is

>>The top-level window

then?
0
 
LVL 92

Expert Comment

by:objects
ID: 9828769
Or if you don't want to switch page for some reason then remove the content from your applets root pane.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9828818
Have you got an applet inside a frame? What is the relationship between application/applet or frame/applet?
0
 

Author Comment

by:dkim18
ID: 9828970
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

0
 
LVL 92

Accepted Solution

by:
objects earned 1000 total points
ID: 9829008
with the code i posted in your other question have your exit action do:

f.hide();

0
 
LVL 92

Expert Comment

by:objects
ID: 9879393
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question