>>>>> John Summerfield writes:

    John> Run the applet thus: appletviewer bug.java

    John> Click your various mouse buttons on the frame window and
    John> take not of its behaviour.  Change directory and run it
    John> again: maybe cd ..  appletviewer javabug/bug.java

    John> Note that this time there's a warning message in the top of
    John> the window warning the user that this is an applet
    John> window. 

Not surprising: In the first case bug.class was found in CLASSPATH
(=> no warning message), in the second case not.

    John> You will also note that some of the text the applet
    John> attempts to display is obscured by this message.

    John> This behaviour is different from that I observe with 
    John>    Appletviewer on NT 4.0 Sp1 JDK 1.1.4
    John>    Netscape 4.something on NT
    John>    Netscape 4.06 on Linux
    John>    Appletviewer on OS/2 JDK 1.1.4
    John>    Netscape 2.02 with Java 1.1.4 on OS/2
    John> and in pictures in my book Just Java, Sun Microsystems.

    John> In all these cases, the warning message is at the bottom of
    John> the window: in principle the user can, if something seems
    John> obscured, resize the window to see what's hidden.

On solaris, unix and other unix system the warning message is at
the top of the window.

    John>      public void paint(Graphics g)
    John>          {
    John>             super.paint(g);
    John>             g.drawString(s,5,40);
    John>             g.drawString(s2,5,80);
    John>             g.drawString(s3,5,120);
    John>          }                            
    John>  }

When working with frames you have to honor the frame's insets.
The insets include the frames border size, the title bar size,
the menu bar size, the warning bar size.
So it's no bug, your code is not 100% portable ;-)

Have you tried to use something like:

Insets insets = getInsets();
int top = insets.top;
int left = insets.left;
super.paint(g);
g.drawString(s,5 + left ,40 + top);
g.drawString(s2,5 + left ,80 + top);
g.drawString(s3,5 + left ,120 + top);



        Juergen

-- 
Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V
Baroper Strasse 301, D-44221 Dortmund, Germany
Phone: ++49 231/755-5806, Fax: ++49 231/755-5802

Reply via email to