advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement

ButtonBar


The applet gets almost all of the information via parameters. The parameters have to be set in the HTML Code, as part of the <applet> tag (To see how to create the HTML code read the HTML code page).

The parameters and their function:

(Parameters marked with a * are required)
 
 

 *  NORMBUTTON This parameter specifies the image file which shall be displayed for buttons in normal condition (not pressed, not highlighted). It has to be a .GIF or a .JPG (.JPEG respectively) file. Remember that filenames on the Internet are case sensitive! The file name has to be written correct, if you mix up lower and upper case it'll cause errors. 
 * HIGHLBUTTON Not all too difficult to guess, is it? The same rules as above apply, only that this parameter specifies the file to be displayed when a button is highlighted (when the mouse is over a button, but the button is not pressed). 
 * PRESSEDBUTTON  It should be obvious...
  SPECNORMBUTTON# You can give a button a different image than the default one with this parameter. It has to have the same size as the default buttons.
  SPECHIGHLBUTTON# Same as SPECNORMBUTTON#, only for highlighted status. 
  SPECPRESSEDBUTTON# Same as SPECNORMBUTTON#, only for highlighted status. 
  BACKGROUNDIMAGE A .GIF or .JPG image which will be displayed underneath the button images. It does not necessarily have to be of the same size as the applet. If it is smaller it will be tiled to fill the entire applet area. 
  MOUSEOVERSOUND The sound which is played when the mouse moves from one button to another. The sounds have to be 8 bit, µlaw, 8000 Hz, one-channel Sun ".au" files.
  PRESSEDSOUND The sound which is played when a button is pressed. The same rules as with "MOUSEOVERSOUND" apply.
  ORIENTATION Default value is vertical. You can make a horizontal buttonbar by setting this parameter to "horizontal". 
  DEFAULTALIGNMENT Defines the text alignments on the buttons. Legal values are: "left" and "right". Not defining this parameter will center the text on the buttons.
  DEFAULTFONTNAME Usually the default font name is "Helvetica" (on PCs running MS Windows this font is called "Arial"). You can change the default name with this parameter, which is more easy than changing the font name for every button manually. For more info on font names see "FONTNAME#". 
  DEFAULTFONTSTYLE Usually the default is "PLAIN". Change the default with this parameter. See "FONTSTYLE#". 
  DEFAULTFONTSIZE "Standard default" is 12. See "FONTSIZE#". 
  DEFAULTFONTCOLOR Default is usually black. 
See also:
  DEFAULTHIGHLFONTCOLOR Usually the buttons don't change their font colors when highlighted. If you want them to do so use this parameter.
See also:
  DEFAULTPRESSEDFONTCOLOR Same as "DEFAULTHIGHLFONTCOLOR", only for pressed state.
See also:
  DEFAULTDESTFRAME If most of the pages have to be displayed in a different frame than the one in which the applet itself is displayed you can specify a default destination frame where all pages will be displayed in. If a single page has to be displayed in a different frame than the default destination frame you have to use the DESTFRAME# parameter. 
  BUTTONSSTAYPRESSED If this parameter is specified the button which was pressed will remain so until another button is pressed. The purpose is to indicate where on a site the viewer is. It doesn't matter which value this parameter has, its pure existence suffices to activate this option.
  STARTBUTTON If the option "BUTTONSTAYPRESSED" is activated button #1 will be in pressed condition after loading. If you want a different button to be pressed after the applet is loaded you can specify its number with this parameter.
  BUTTONALIGNMENT# You can set a different text alignment for each button with this parameter. Legal values are "left" and "right". 
 * BUTTONTEXT# The text to be displayed on the button. Make sure it's not too long, the applet won't check the length. 
 * DESTURL# Same as with the TEXT# parameter, but this time you specify the URL to which you want to link this button. URLs can be relative or absolute, even targets should work fine. 
See also:
  DESTFRAME# You can define a frame in which you want to appear a page a button is linked to. But you don't have to, if you don't specify a destination frame, the page will be loaded in the current frame. 
  STATUSMESSAGE# You can define a short statement which will appear in the status bar of your browser when the mouse arrow is over a button. This statement might be a short description of what the page that's going to appear contains. 
  FONTNAME# Every button can have a different font, the name of which you define with this parameter. Valid values are: 
  • Dialog
  • Helvetica (On machines running MS Windows this is "Arial")
  • TimesRoman (On machines running MS Windows this is "Times New Roman")
  • Courier
  • DialogInput
  • ZapfDingbats
Default is Helvetica. 
  FONTSTYLE# The three valid options are: PLAIN, ITALIC and BOLD. If you skip this parameter the font will be displayed PLAIN. 
  FONTSIZE# Pretty obvious... Of course you can't use all numbers, i.e. a font of the size 100 won't work. Use the font sizes which work also in your word processing tool. Default is 12. 
  FONTCOLOR# If you want a button to have a different font color than the default color for normal status use this parameter. 
See also: 
  HIGHLFONTCOLOR# If you want a button to change its font color when being highlighted use this parameter. 
See also:
  PRESSEDFONTCOLOR# Same as "HIGHLFONTCOLOR#", only for pressed state. 
See also:

How to define colors:

Generally, there are two ways to define a color:

  1. HTML-like: In HTML a color is defined by three hexadecimal numbers between 0 and 255. These numbers represent the RGB values, that is the red, green and blue shares of the color. By defining the RGB values you can mix any color you like. For example, to get a red color like this one you had to define the shares like this: Red = 255, Green = 0, Blue = 0. In hexadecimal numbers this would be: Red = FF, Green = 0, Blue = 0. Thus, to define the color red in HTML you would write "ff0000" (it doesn't matter whether you write the letters upper- or lowercase). Many image processing applications have a feature to convert colors to hexadecimal RGB values. If you do not have such an application yet you might wish to visit www.jasc.com and download the shareware version of "Paint Shop Pro".
  2. Shortcuts: I built in shortcuts for some of the most common colors. The shortcuts are:
    • black (is also default)
    • blue
    • cyan
    • darkgray
    • gray
    • green
    • lightgray
    • magenta
    • orange
    • pink
    • red
    • white
    • yellow
Defining image/audio clip locations and URLs

You can specify URLs in two ways: either you give the applet just a filename or you specify an entire URL. If you use just a filename with no path information, the applet will automatically add the path of the HTML document to create a complete URL.

Example:

If one of your "DestURL#" parameters links to: "buttonbar_mainframe.html", the applet will automatically add the document's path to this. The complete URL (which the applet will use to call the document) will be:

http://welcome.to/javaforall/buttonbar_mainframe.html

(assuming that "http://welcome.to/javaforall" is the URL where the HTML document is residing).

You can also link to pages which are stored in subdirectories. A link to a page which is in a subdirectory called "html_documents" would look like this:

html_documents/buttonbar_mainframe.html

(of course the applet will add the path of the HTML document to this, as it is not a complete URL).

Image locations are different. You cannot use a complete URL to define an image location. The applet will always add the URL of the HTML document into which the applet is embedded to the location. But of course you can also use subdirectories.

Back to ButtonBar

How to Add Java Applets to Your Site

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.

 DevX Skillbuilding from IBM developerWorks
 RIA Run Contest: Build Next-Gen Apps in Microsoft Silverlight 2
 Avaya DevConnect Center
 Intel Go Parallel Portal
 Internet.com eBook Library
 Microsoft RIA Development Center
 Destination .NET
XML error: not well-formed (invalid token) at line 53
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

SaaS Tool Offers Custom Database Development
Microsoft’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0
Out with the Old, in with the New at JavaOne
Trolltech Expands WebKit Footprint
Oracle: Eating its Own Open Source Food
Big Money and Open Source May Not Compute
Open Source Embrace Gives Sun New Fans
NetBeans, OpenSolaris Also in Spotlight at JavaOne

Clean Up Function Syntax Mess with decltype
Sutter Speaks: The Future of Concurrency
INTEL SCAVENGER HUNT, LENOVO X300 AND APPLE IPOD TOUCH GIVEAWAY (the "Giveaway")
Comparing Multi-Core Processors for Server Virtualization
Intel® Desktop Business Computing Solutions
Intel: What Downturn?
Managing the Evolving Data Center
Implement Drag and Drop in Your Windows Forms Applications
Processing Linked Web Data with XSLT
New Platform Security Tweaks Nokia's Python for S60 Application Development

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES