Link to home
Start Free TrialLog in
Avatar of madforplaid
madforplaid

asked on

HTML close button on top of applet...

Can anyone tell me if so, and how, I can add an HTML close button to cover a small portion of the bottom corner of my applet?

The applet takes up the fullscreen, and I would like to include a close button so users know how to close the window.  Most people do not know about the Alt+F4 keystroke combination to close a full screen window <one without the taskbar or title bar>.

Thanks,

Paul
Avatar of Mick Barry
Mick Barry
Flag of Australia image

As far as I know an applet cannot close the browser window.
Myabe you can do it with some Javascript, how does the window get to full screen mode in the 1st place.
Why not just put some instructions on the page on how to close the window.
Avatar of rac13
rac13

If not u can include frames into it. The top frame consist of your html close button and the bottom frame would consist your applets.
Maybe this will work: you can have a close function (button) in your applet, where you try to open a new html page with this code:

getAppletContext().showDocument(new URL("close.html"));

and close.html have javascript code for closing this window:

<html>
<body onload="javascript:window.close();">
</body>
</html>

Hope it works!
Avatar of madforplaid

ASKER

Thank you all for getting back to me.

Again, I'd like to add an HTML close button to cover a small portion of the bottom corner of my applet.  The purpose of the close button is so users know how to close the window since the applet and the HTML window fills up the full height of the screen (including the title bar).

If interested, I have uploaded several image files to review for testing purposes.

First, view the following image:  http://www.mindspring.com/~lkkl/appletWindowTaskbar.jpg

This image is when one has the taskbar set to 'Always on Top'.  You'll see that the applet doesn't quite fit within the window flush; too much white space is showing.  I even commented off the <p>, <table>, etc. tags within the HTML to try to get it to work.  I then adjusted the width and height settings accordingly in the ASP pages that generate the params to the applet to make it as flush to the border as possible, but I still have the white space surrounding the applet itself.  Any ideas on how I can get the applet to open flush within the new window?

For reference, the following two links show the text code of the ASP files used to generate the applet.  

This ASP page is where one selects an airline and then a flight number after the select drop-down box has been populated:  http://www.mindspring.com/~lkkl/trackerform_test.asp.txt  This ASP page displays the applet that is shown in the other image links:  http://www.mindspring.com/~lkkl/flighttracker_test.asp.txt

Next, view this image of the flighttracker_test.asp page:  http://www.mindspring.com/~lkkl/appletWindowNoTaskbar.jpg

This image is when one does not set the 'Always on Top' feature.  It clearly shows the X close that I would like to appear within the applet!  Ideally, I would like the close button to appear 'on top' of the applet, but when I adjust the height and width params of the button in relation to the applet, it disappears underneath the applet.

To see an example of how I'd like the applet to look like, view the last image that I doctored using Photoshop:  http://www.mindspring.com/~lkkl/closeButtonApplet.jpg

--------------------

I might have to adjust the dimensions of the map images to fit in the new window, but it would be great if I could make the X button appear as it does in the closeButtonApplet.jpg image.

Any other ideas on how to get this to function is much appreciated.

Thanks,

Paul

PS  I am also increasing the points to 50!
Well, I'm not sure if it is possible to do, maybe with layers, but I have no idea if it would work. Why not place this button directly on the applet surface? You could place it on top, or as you show it in closeButtonApplet.jpg.
my_moon,

I'll give the layer or iframe idea a try...

The X Close Button in closeButtonApplet.jpg was manipulated using Photoshop.

Do you know how I can place it on top using HTML/JS or within the .java code?

Thanks,

Paul
ASKER CERTIFIED SOLUTION
Avatar of my_moon011000
my_moon011000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
madforplaid:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
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:

- Points for my_moon

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Venabili
EE Cleanup Volunteer