Solved

HTML close button on top of applet...

Posted on 2001-08-16
9
224 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 1

Author Comment

by:madforplaid
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:my_moon011000
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 71
array220 challenge 8 44
computer science syllabus 3 52
groovy example issue 10 65
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
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…

762 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

6 Experts available now in Live!

Get 1:1 Help Now