Java Code provided by Avon Edward Foote on request for
Microsoft JVM Team to consider in search for IE 4.0 problem
-- email exchange with Microsoft.com follows code
import java.awt.*;
import java.applet.Applet;
import java.net.*;
import java.awt.Image;
import java.lang.String;

public class MyCHOFlow extends Applet{
public void init() {
        
       
        setBackground(Color.black);
 
       
        MyCHOFrame n = new MyCHOFrame("CHOTANK Wins with Java");
 
        n.resize(450,250);
        n.show(false);
        n.reshape(200,0,450,250);
        n.validate();

        getAppletContext().showStatus("Avon Edward Foote, Ph.D., Chotank WebMaster");

        n.repaint();
        n.show();

}
  
}


 class MyCHOFrame extends Frame{
                      
              
             static Image meltimage;
             static String where="http://chotank.com/classes/images/meltlogoTWO.gif";   
             static URL url;
             MyCHOFrame(String title){
                   super(title);
                  
                   setBackground(Color.blue);


                   pack();
                   }
            
                
                       

             static{
                 try { url=new URL(where); }                       
                 catch (MalformedURLException mue){
                      System.out.println("Bad URL:" + where);
                 }

    
              meltimage=Toolkit.getDefaultToolkit().getImage(url);
              }

public Insets insets(){
          return new Insets(0, 20, 0, 20);

          }

               
               public void update(Graphics g){
                   paint(g);

                  }
                 

               public void paint(Graphics g){
                  g.drawImage(meltimage,0,20,450,210,this);
                  }
             
                public synchronized boolean handleEvent(Event evt){
                if (evt.id == Event.WINDOW_DESTROY) {
                   this.hide();
                    return true;
                    }
                 return super.handleEvent(evt);
                 }
  
      }                        

Code requested by Simon Cooke, (Exchange), Microsoft.com

Next -- email evaluation from Simon Cooke, then Chotank responds

2/3/99

Cool:)

BTW: I'm not actually "on" the JVM team -- I'm on the Visual Studio UI Controls team, but I'll pass this on to those guys -- I scour the web a fair bit trying to find things we need fixing ('sall part of the job).

I've attached a GIF of the screen as I see it, running the current Microsoft JVM. Is this what you see when you run it?

For now though . . .

Looking through your code, in MYCHOFrame, you have a static initialiser which goes through the Toolkit class to download the image; the problem with this is that Toolkit is really only supposed to be used with Peer components and their generation; if you're using an Applet, you should be calling the getimage() method on the Applet.

Also, you're using a lot of old code in there -- 99% of the methods you're using appear to be deprecated. An finally, Netscape <--> IE JVM compatibility is a painful subject -- the Netscape JVM does a lot of things wrong (before I worked at Microsoft, I wrote a UI controls package in Java that attempted to get around the incompatibilities between the two). To be honest, the best thing to test against is Sun's appletviewer; if the code works correctly on there, then the error is most likely in the browser; otherwise it's in your code.

Hope this helps -- let me know what you think, and I'll pass this on to the JVM guys.

Thanks,
Simon

This is the Chotank response to Simon -- Is it a winner?

Sat, 6 Feb 1999 07:49:03 EST

To: simcooke@Exchange.Microsoft.com

Subject: Code Sample??

Hello Simon,

First, let me express my appreciation for your attempts to find the source of the problem which I have identified and for insights. Any "poor" [read "tacky"] tactics which I use because the browser wars are such a prominent controversy should not in any way take away from a "heartfelt" understanding that you don't have to be helping a small college professor with a very obscure web site.

But now to the comments you made about the code and browsers:

You will have to give me a reference citation that says something to the effect: "You cannot use Toolkit for Applet-related downloads." Otherwise, I cannot accept your opinion on this.

Your statement about the old code is very overblown. The MyCHOFlow.java code was written long before the release of JAVA 2.0. And, as you know, the compiler lists which classes are depreciated/deprecated. Therefore, the programmer knows which parts of the code are outdated. According to Sun, outdated code should run anyway, and it does on Netscape.

As to using the Sun appletviewer for setting my own expectations of browser compatibility, that is what I have done. All Applets are first evaluated on the appletviewer before loading on the web site.

The point is that Netscape [4.0] will run the code and IE [4.0] won't. In my mind, that makes IE inadequate. Taking a position that Netscape is inferior because it will do what Sun expects a browser to do is not a good argument as I see it. Your statement that "the Netscape JVM does a lot of things wrong" is an expected Microsoft line in comparisons like these.

Since you are on the Visual Studio UI Controls team, rather than the JVM team, which I thought was the situation when we started this exchange, I think my next correspondence should come from the JVM people.

This exchange will be posted on the web site.

Thanks again,

Avon Edward Foote

P.S. Since you are in the UK, I wanted you to know that recently I had an informative tour of the Electronic Telegraph, the internet edition of London's Daily Telegraph. Most pleasing was the tea break overlooking the new Millennium Dome at Greenwich from the 12th floor of Canary Wharf.

More email on subject from Microsoft.com

Return to exhibit page

Copyright (c) 1999, Avon Edward Foote, All Rights Reserved

February 6, 1999 old yes old