Solved

File menu and Exit: Invoking closing the window

Posted on 2003-11-25
10
265 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
  • 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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 250 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now