Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > confussed about showStatus in java.applet.Applet

Reply
Thread Tools

confussed about showStatus in java.applet.Applet

 
 
yawnmoth
Guest
Posts: n/a
 
      08-15-2006
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". Unfortunately, that's not what I want it to say.

Here's HelloWorld.java:

import java.applet.Applet;

public class HelloWorld extends Applet
{
public void start()
{
showStatus("Hello, world!");
}
}

And here's test.html:

<applet width="1" height="1" code="HelloWorld.class">
</applet>

Any ideas?

Also, is there any way to output text other than showStatus or without
using java.awt.Graphics?

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      08-15-2006
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
this.showStatus not working... FB Java 5 01-11-2008 04:41 AM
showStatus() doesn't work on Netscape and Mozilla joealey2003@yahoo.com Java 1 01-13-2005 07:51 AM
70-300 confussed ami MCSD 1 11-12-2004 10:34 PM
Confussed: pointers from Kernigan & Richie someone@somedomain.net C Programming 3 07-16-2004 12:20 AM
Confussed: Pointers in Kernigan & Richie. someone@somedomain.net C++ 5 07-15-2004 06:54 PM



Advertisments