Solved

How to click a button and close the browser

Posted on 2002-03-08
5
225 Views
Last Modified: 2010-03-31
Hi, there,

I'm using Java Applet to devlope a project.  Is there any way to click a button on the applet (e.g. "Exit" button), and cause the whole browser to be closed?

daisy
0
Comment
Question by:DaisyWang
5 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 6851405
try:

getAppletContext().showDocument(new URL "javascript:self.close()"));
0
 

Author Comment

by:DaisyWang
ID: 6851425
bobbit31,

it doesn't work.

daisy
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 50 total points
ID: 6851461
sorry that was for netscape only (i still couldn't get it to work)

see this page: http://www.rgagnon.com/javadetails/java-0172.html

it has all the details on calling js from applet.
0
 
LVL 9

Expert Comment

by:Venci75
ID: 7902165
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: bobbit31
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7962793
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
V.simple question about Android packages and libraries 1 29
Protect jar file - windows app 2 65
map related example 6 55
type mismatch (Object[] to double[] 4 33
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

809 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