MenuApplet
MenuApplet How to
This is a short description about how to configure the MenuApplet java applet.
1. What is menu Applet?
This is a navigation pallet applet that can run in a floating window
or in a frame. It is very useful in big sites because it helps the
visitor to find a web page without navigating through the site.
2. Files the applet needs to work.
MenuApplet.class
LabelButton.class
MenuApplet.ini - configuration file.
These files must be placed in the same directory.
Other files:
MenuApplet_How_to.html, screen.gif - this documentation.
3. How this applet looks.
You can see two columns.
The first one, labelled "Select" is the column with categories.
The second one, labelled "Go to" contain Links.
Clicking on a category the applet loads its links in the "Go to" menu.
The configuration of the categories is loaded from the MenuApplet.ini file.
4. Installation.
First you have to write the MenuApplet.ini file. This is a sample:
+Test pages+
\test1\ "test_html/test1.html"
\test2\ "test_html/test2.html"
\test3\ "test_html/test3.html"
\test4\ "test_html/test4.html"
\test5\ "test_html/test5.html"
+Links+
\My page\ "http://www.obs-us.com/people/mihai"
\Real Media\ "http://www.real.com"
\Netscape\ "http://home.netscape.com"
\Yahoo\ "http://www.yahoo.com"
\Altavista\ "http://altavista.com"
\CNN\ "http://cnn.com"
All lines that doesn't start with '+' or '\' character are ignored
A line starting with a '+' means that the following characters
until the first '+' are the name of a category (select menu).
A line starting with a '\' means that the following characters until the
first '\' are the name of a link (go to menu). These lines starting
with '\', must be after a category line. All these lines until the next
category name or the end of the file are the links for the category.
After a link name, between quotes, it is the e URL of the link. It can be
a relative URL from the class files, or an absolute URL.
The absolute one must start with "http://"
Important!
The maximum number of categories or number of links in a category is 20.
It means that the maximum number of links is 20*20=400.
The applet tag.
This is a sample:
<APPLET CODE=MenuApplet.class WIDTH=260 HEIGHT=150>
<PARAM NAME=TargetWindow VALUE="LoadHere">
<!--this parameter can have following values:
"_blank"
Display the document in a new window
"WindowName"
Display the document in a window
named windowname
"_self"
Display the document in the window (frame)
that contains the applet
"_parent"
Display the document in the parent frame
"_top"
Display the document in the top-level frame
the default value is "_self"
-->
</APPLET>
The tag has only one parameter, named TargetWindow.
How to calculate the size of the applet.
HEIGTH=(n+1)*18, where n is the maximum number
of the categories or links in a category
WIDTH >= 12+(p*7)+(q*7). p is the number of characters in the longest
category name. q the number of characters in the longest name of a link.
If the WIDTH is larger, the "Go to" section of the applet will be larger.
The "select" section will preserve its width.
If the longest name of the categories contains very wide
characters can be truncated. In this case add one or
more space characters after its name in the ini file.
If the applet is too narrow for the "go to section",
just make the WIDTH attribute in the APPLET tag bigger.
How to make the applet to work in a floating window.
You need a little java script that will bring up a window with the applet.
For example you can place a button in the page:
<FORM>
<INPUT TYPE="button" NAME="Button1"
VALUE="Open Menu Window!" onClick="window.open('menu.html',
'displayWindow', 'menubar=no,height=166,width=244')">
</FORM>
The width and the height of the new window must be about 20
pixels bigger than the width and the height of the applet.
If the window you want to load the links in doesn't have a name,
just add in the head section of the HTML file the following code:
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.name="LoadHere";
//-->
</SCRIPT>
</HEAD>
The TargetWindow parameter in the APPLET tag must be "LoadHere".
If you use the applet in a frame (not in a floating window)
or if you want to load the documents in a frame,
the frame it is already named in the FRAMESET tag.
5. License
Menu Applet 1.0
Copyright (C) 1998 Mihai Munteanu
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
You can contact me at:
* http://www.obs-us.com/people/mihai
* e-mail: m.munteanu@shef.ac.uk or mmm@deltanet.roknet.ro
* Mihai Munteanu
str. M.Eminescu 44
2200 Brasov, ROMANIA
* fax: +40 (0)68 410330
Back to the MenuApplet page
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|