Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / September 2004

Tip: Looking for answers? Try searching our database.

showStatus() not working?

Thread view: 
Radario - 17 Sep 2004 00:26 GMT
I am running Redhat Linux 9.0. I am using Firefox 0.9.3 and Mozilla 1.7.2.
When I was using j2sdk1.4.2_02 the showStatus() method worked just fine in
my applet. I have upgraded to j2sdk1.4.2_05 and now showStatus() does not
appear to function at all. Has anyone else noticed
this or is it something unique to my machine?

Signature

"No matter how well you do something there are about
a thousand guys who can do it better."
Radario

Andrew Thompson - 17 Sep 2004 08:25 GMT
> I am running Redhat Linux 9.0. I am using Firefox 0.9.3 and Mozilla 1.7.2.
> When I was using j2sdk1.4.2_02 the showStatus() method worked just fine in
> my applet.

URL?  Link to the code.

>..I have upgraded to j2sdk1.4.2_05 and now showStatus() does not
> appear to function at all. Has anyone else noticed
> this or is it something unique to my machine?

I noticed nothing out of the ordinary,
in the example you did not provide.

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane

Radario - 17 Sep 2004 17:42 GMT
>>I am running Redhat Linux 9.0. I am using Firefox 0.9.3 and Mozilla 1.7.2.
>>When I was using j2sdk1.4.2_02 the showStatus() method worked just fine in
[quoted text clipped - 8 lines]
> I noticed nothing out of the ordinary,
> in the example you did not provide.

Here is the code to test what I'm talking about. Using Mozilla 1.7.2 and
the java plugin 1.4.2_02 this applet properly displays the phrases
'Mouse Over' and 'Mouse Out' in the status bar of the browser. When I
change the plugin to 1.4.2_05 the showStatus("Mouse Over") method does
not display anything in the browser status bar. Also the usual 'Applet
loading' and 'Applet started' messages do not appear. I have tested this
on two different computers, one running Redhat 9 and Vector Linux 4.0.
Is there a bug in jre1.4.2_05 or has this method been changed?

<html>

    <head>
        <title>Scroller Applet</title>
    </head>
    <body bgcolor="#000000" text="#ffffff">
        <h1>Scroller Applet</h1>
        <hr>
<APPLET CODE = "BasicApplet.class" WIDTH = 420 HEIGHT = 280>

</APPLET>
        <hr>
    </body>
</html>

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;

public class BasicApplet extends Applet implements  MouseListener
{
   String temp;

   public void init()
   {

    addMouseListener(this);
    setLayout(null);
    setBackground(Color.black);
   }

   public void paint(Graphics g) {
          g.setColor(Color.white);
      g.drawString(temp,20,20);

   }
   public void mousePressed (MouseEvent me) {}
   public void mouseReleased (MouseEvent me) {}

   public void mouseEntered(MouseEvent me) {
      showStatus("Mouse Over");
      temp = "Mouse Over";
      repaint();
   }
   public void mouseExited (MouseEvent me) {
       showStatus("Mouse Out");
       temp = "Mouse Out";
       repaint();
   }
   public  void mouseClicked(MouseEvent me) {}

   public void stop() {}

}

Signature

"No matter how well you do something there are about
a thousand guys who can do it better."
Radario

Radario - 17 Sep 2004 18:08 GMT
http://flying.to/craig

This link has a simple applet. Change your jre and see what I mean.

Signature

"No matter how well you do something there are about
a thousand guys who can do it better."
Radario

Andrew Thompson - 17 Sep 2004 19:27 GMT
> http://flying.to/craig
>
> This link has a simple applet.

I did visit it, simply to confirm it was the same
code that threw NPE's in AppletViewer (you forgot
to initialize 'temp' prior to an onMouseOver/Out event.)

It was indeed the same code.

>..Change your jre and see what I mean.

Well.. not only am I not intending to install
early 1.4.2 releases, I am not (at this stage)
intending to install Linux.  So I will have to
take your word for it.

Basically Radario, I wanted to confirm you were
not doing anything terribly silly in your code
that might cause the error.  You are not.

While I am unfamiliar with the exact interaction
of the showStatus command with all JRE versions
on all OS's, I have to concede that pretty much
nothing surprises me when further browser/JRE
interaction quirks are discovered.  

The only information I would put in the status bar
would be 'interesting but not vital' information..
(which almost reduces it to 'nothing')

If you have information that is vital to the user,
either display it in the applet itself, or show a
Dialog.

HTH

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane

Radario - 17 Sep 2004 19:12 GMT
http://flying.to/craig

This link has a simple applet. Change your jre and see what I mean.
jre1.4.2_02 works and jre1.4.2_05 does not.
Signature

"No matter how well you do something there are about
a thousand guys who can do it better."
Radario

Radario - 17 Sep 2004 20:05 GMT
Thanks for replying. I agree with you and I think I'll take your advise
and keep any relevent info in the applet itself.

Signature

"No matter how well you do something there are about
a thousand guys who can do it better."
Radario

Andrew Thompson - 17 Sep 2004 20:17 GMT
> ..I think I'll take your advise
> and keep any relevent info in the applet itself.

Way to go.  There is too much time spent on fixing
(or attempting to fix) these quirky problems that
are best fixed with a different approach.

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.