Solved

HTML close button on top of applet...

Posted on 2001-08-16
9
229 Views
Last Modified: 2012-06-22
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
0
Comment
Question by:madforplaid
9 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6391681
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.
0
 

Expert Comment

by:rac13
ID: 6391826
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.
0
 
LVL 1

Expert Comment

by:my_moon011000
ID: 6392375
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!
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:madforplaid
ID: 6395770
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!
0
 
LVL 1

Expert Comment

by:my_moon011000
ID: 6396039
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.
0
 
LVL 1

Author Comment

by:madforplaid
ID: 6397837
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
0
 
LVL 1

Accepted Solution

by:
my_moon011000 earned 50 total points
ID: 6405769
I tried to do it with layers - no good. So how about positioning the button on the top "white space" above the applet? Try with zeros at left and top of the button and see what happens.

Including the button in the applet is elementary java programming.
0
 

Expert Comment

by:CleanupPing
ID: 9061853
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.
0
 
LVL 20

Expert Comment

by:Venabili
ID: 9332408
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
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet example issue 6 46
jdbc error in jsp application 20 63
spring jars download 1 35
servlet and mdb, jms error 1 32
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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 third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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…

856 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