Can a Java applet write information to the status bar of a browser?
Question: Can a Java applet write information to the status bar of a browser?
Yes, Java applets can write to the status bar of a browser.
(If you're not familiar with the terminology, the status bar is the bar located at the bottom of your browser. It's also called a status line or status window.)
However, consider yourself warned that the status bar is configurable in many browsers, so it's possible that the user can hide the status bar -- and never see the message you're writing. In practice, though, it seems that most users leave the status bar alone, so it's usually worth the small extra effort to write to the bar. In fact, it's so easy to do this in your Java applets that I recommend it.
Here's all the Java code you need in an applet to write to a browser's status bar:
// How to write to the status bar of a web browser // using Java: showStatus("Hello, world!");
Just use the
showStatus() method in your applet any time you want to write to the status bar. An example of this can be found in our AnimatedAd applet. In this applet, we write a brief message to the status bar each time a user moves their mouse over the applet, and the message "sticks" to the mouse pointer.
You'll find the
showStatus() method documented in the
java.applet.Applet class documentation.
<HEAD></HEAD> tags of your HTML code, and change the string to provide the description you'd like.