Re: confussed about showStatus in java.applet.Applet
yawnmoth wrote:
I have a file - HelloWorld.java that uses showStatus - and test.html
(that includes HelloWorld.class as an applet) - and... showStatus
doesn't seem to be working. According to the description on
java.sun.com...
"Requests that the argument string be displayed in the "status window".
Many browsers and applet viewers provide such a window, where the
application can inform users of its current state."
I'm not really sure what this status window they're refering to is, but
I assume it to, in FireFox, be the part that says "Applet HelloWorld
started".
Correct. Noite that Sun's wording there is significant
in the word 'request'. A browser/UA may not even have
a status line (e.g. the UA is in 'full screen' mode, or the
applet is in a pop-up with no window decorations).
for that reason - only information that the end user can
do without, should be dsiplayed there. The only thing
I have used showStatus() for, is to show the applet version..
...Unfortunately, that's not what I want it to say.
I suspect the problem is that your message is being written,
*then* the browser's own 'applet loaded' message
overwrites it. Try showing your message after the user
clicks a button.
Also, is there any way to output text other than showStatus or without
using java.awt.Graphics?
Sure. You can put a (J)Label (or other txt componenent) in
your applet for messages, or in a (J)Dialog, (J)Frame,
JWindow, JToolBar or JOptionPane.
There are other methods of producing a message as well,
but any of the above would probably be better.
HTH
Andrew T.