Frontier Java   Frontier Java
 home  |  source code  |  articles  |  patterns  |  contact  |  what's new  |  site map  |  resume 
Search
Free source
Applets
JavaScript
 

fjMenu applet

Welcome to my menu bar applet. It was developed with Visual J++ 1.1, part of Microsoft Visual Studio 97


Examples


The parameters

Here is the code for the middle menu bar at the top of this page.

<applet code=fjMenu.class width=600 height=30>
<param name=bgColor value="000000">
<param name=lnColor value="000000">
<param name=itemColor value="000000">
<param name=selectColor value="ff0000">
<param name=fontColor value="ffffff">
<param name=fontselColor value="000000">
<param name=fontSize value=14>
<param name=menuStyle value=2>
<param name=menuDefault value=1>
<param name=centerHoriz value=1>
<param name=labelDefault value="Select an item">
<param name=labelPrefix value="Click to jump to the">
<param name=labelSuffix value="page">
<param name=numitems value=3>
<param name=text_1 value="My Applets">
<param name=url_1 value="applets.html">
<param name=label_1 value="applets">
<param name=text_2 value="Java">
<param name=url_2 value="java.html">
<param name=label_2 value="java resources">
<param name=text_3 value="JavaScript">
<param name=url_3 value="javascript.html">
<param name=label_3 value="JavaScript Resources">
</applet>

  • bgColor - default: a8a8a8 (lightGray)
  • lnColor - default: 000000 (black)
  • itemColor - default: 000000 (black)
  • selectColor - default: ff0000 (red)
  • fontColor - default: ffffff (white)
  • fontselColor - default: 000000 (black)
  • fontName - default: "Helvetica"
  • fontStyle - default: 0 values: 0=plain 1=bold 2=italic
  • fontSize - default: 14
  • menuStyle - default: 0 values: 0=rectangle 1=oval 2=rounded rectangle
  • menuDefault - default: 0
  • centerHoriz - default: 0 value: 0=no 1=yes
  • centerVert - default: 0 value: 0=no 1=yes
  • labelDefault - text to display on status line when no item is active
  • labelPrefix - text to display on status line before item text
  • labelSuffix - text to display on status line after item text
  • targetDefault - default target frame if item target is empty
  • numitems - number of items in menu

For the item parameters described below, the 'n' is the item number, beginning with 1 and going up to the value of the numitems parameter.

  • text_n - the text to display on the item.
  • url_n - the URL to open when the item is clicked.
  • target_n - the target frame in which to open the URL.
  • label_n - the descriptive text that appears in the status bar, along with the labelPrefix and labelSuffix.
  • selectColor_n - override the default selected item color
  • fontselColor_n - override the default selection item font color

note: the colors used are of the six digit rgb type.

note: when using urls containing anchors, the pound sign ('#') will only work correctly if escaped with another pound sign. Example:

<param name=url_4 value="/speedy/locator.htm##bc">

Downloads


Updates

  • Aug8/97 - parameters for font name, style and size added
  • Aug11/97 - parameter menu default added
  • Aug11/97 - parameters for centerHoriz & centerVert added
  • Aug11/97 - menuStyle 1 & 2 added
  • Aug19/97 - parameters for labelDefault, labelPrefix and labelSuffix added
  • Aug19/97 - variable parameter for label_n added
  • Aug21/97 - parameter default target added
  • Aug22/97 - submitted to JARS, the Java Applet Rating Service, for review

Bug Reports

This applet has been carefully tested and was used on my own websites before being available here. However, totally bug free code is rare and if any problems/bugs do appear, please email me at frontierj@oocities.com. If you have any comments or suggestions for future enchancements, please email me those as well.


Future/planned improvements

  • menus laid out vertically or in a table
  • LCARS menustyle (the menus on the control panels in Star Trek Next Generation)
  • more item parameters including sound and overlay images

  Last updated: 2000 04 06