So, You Want A Pop-Up Link Box, Huh?

By Joe Burns

Use these to jump around or read it all...
[Here We Go]
[The Applet]
[The Source Code]
[Configuring It For Your Needs]
[Posting It On Your Page]

First Java Things First: This is a tutorial dealing with a Java Applet. These little guys are picky. They like to be run on 32-bit platforms only. That means you must be running Windows 95 or a higher level of MAC OS or OS/2. You'll also need a 32-bit platform browser. Head to the Netscape or the Explorer home pages and grab one for yourself. Also, in case you're wondering, according to the November 25th edition of COMPUTERWORLD, there is a Java plug-in that may soon be available that will allow applets to run on Windows 3.x. The problem is you'll probably have to buy this one.

Here We Go...

     I get at least a letter a week asking if you can turn the pop-up box I show in my forms tutorial into something that will take people to other pages. With just HTML commands, no. Using a Java applet, yes. And here it is:

     Go ahead, click on it. It will drop down and the choices you can make will be shown. Choose one, and you're off to that page. Neat trick, huh? I should have one of those at the bottom of each of my tutorials. But I have one on this tutorial, and that's what we're concerned with for now, isn't it?

The Applet

     You're going to need two things for this pop-up box to work for you: The Applet and its Source Code. The applet's name is "link.class." Click here to get it:

Here's the Applet!

     When you click on the link above, it may look like I'm foolin' you because you'll only see some strange writing up in the left-hand corner. Don't fret! That's it! Save it as "source" or "All Files" or "Raw Data" depending on what your browser allows. Saving it as text will mess it up!

     To ensure a good download, Netscape users can hold the shift key while clicking. MSIE users can click the right mouse button and choose to download. MAC users can hold the mouse button and choose download. Doing this often solves later problems.

The Source Code

<APPLET CODE="link.class" WIDTH=150 HEIGHT=70>
<PARAM NAME="target" VALUE="_top">
<PARAM NAME="bgColor" VALUE="white">
<PARAM NAME="number" VALUE="5">
<PARAM NAME="link0" VALUE="Select a Link\\not a link">
<PARAM NAME="link1" VALUE="CBS Home Page\\http://www.cbs.com">
<PARAM NAME="link2" VALUE="CNN Home Page\\http://www.cnn.com">
<PARAM NAME="link3" VALUE="Ford Home Page\\http://www.ford.com">
<PARAM NAME="link4" VALUE="Shareware Home Page\\http://www.shareware.com">
<PARAM NAME="link5" VALUE="Hair Club For Men\\http://www.hairclub.com">

Just cut and paste it from here!

Configuring It For Your Needs

     If you just copy what I have above, you'll get the five links that I have requested of the applet. If that's good enough for you, great. You're done. If not, you'll need to change things around to work for you. Here's how we do it:

  • Leave the first two lines alone!
    Making the size bigger or smaller will mess it up!
  • Change the color surrounding the Box.
    Change the color in the third line to an acceptable word color code. You'll find a list of them here.
  • Change the number of links available to the reader.
    Change line 4 to whatever number you'll offer. I'm offering five.
  • Leave line 5 alone!
    The "link0" line must remain as-is.
  • Offer new links.
    See the format of this line?

    <PARAM NAME="link1" VALUE="CBS Home Page\\http://www.cbs.com">

    In order to offer a different link, you'll need to change the value and the link. Note the two are separated by a double backslash. Leave that in there. Just keep doing that again and again with new links and values and link numbers, link1, link2, link3, etc., until you offer the amount denoted in line 4.

  • That should do it.

Posting It On Your Page

  • Place both the applet and the source code in the same directory. Make sure to FTP or transfer the applet as Raw Data or Binary, depending on your system. Failure to do that will corrupt the applet and kill all your pop-up fun.

         That's the meat of the tutorial. All I ask is that you place a link to the HTML Goodies page if you get the chance! Please? I'm beggin' ya!

[Here We Go]
[The Applet]
[The Source Code]
[Configuring It For Your Needs]
[Posting It On Your Page]

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
Thanks for your registration, follow us on our social networks to keep up-to-date