Images not appearing on IE - 6.00.2600.0000 andJava - Kawa Version 3.2

Hi All,
I have  :  IE - 6.00.2600.0000    and      Java - Kawa Version 3.2. Seems that no matter what I do I cannot get the images that are in my applet to show up on my browser. Yes there is a blue applet area.  Is there any way to get this to happen with the program below?

Both the gifs are in the folder with the .class  

<HTML>
<applet code="NormalSine.class" width="500" height="200"></applet>
</HTML>


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


public class NormalSine extends Applet {
      Image imageBG1;
      Image imageBG2;
      MediaTracker mt;
      private java.awt.Point clickPoint = null;
      public void init() {
            setBackground(Color.blue);
            URL baseURL = getCodeBase();

            addMouseListener(
            new MouseAdapter() {

                  public void mousePressed(MouseEvent event) {
                        clickPoint = event.getPoint();
                        repaint();
                  }
            });

            try {
                  imageBG1 = getImage(baseURL, "Pattern0.gif");
                  imageBG2 = getImage(baseURL, "Pattern1.gif");
                  mt = new MediaTracker(this);
                  mt.addImage(imageBG1, 1);
                  mt.addImage(imageBG2, 2);
                  if (mt.isErrorAny()) {
                        System.out.println("Media error occurred 1.");
                        imageBG1 = null;
                        imageBG2 = null;
                  }
                  mt.waitForAll();
                  if (mt.isErrorAny()) {
                        System.out.println("Media error occurred 2.");
                        imageBG1 = null;
                        imageBG2 = null;
                  }
            } catch (Exception e) {
                  mt = null;
                  System.out.println("Could not do image!");
                  imageBG1 = null;
                  imageBG2 = null;
            }

      }
      int k = 17 ;
      int[] arrayOfInts1 = new int[k];
   // the images are 25 by 99,I Think :)
   // there is a need to expand this to 17 images wide.


      public void paint(Graphics g) {
            for (int i = 1; i < k; i++) {
                  g.drawImage(imageBG1,i * 25 + 1,5,25,98, this);
            }
            if (clickPoint != null) {
                  int X = (int)clickPoint.getX();

                  if ((X > 0) && (X < 51)) {
                        X = 25; if (arrayOfInts1 [0] > 1) {arrayOfInts1 [0] = 0;}
                 else if (arrayOfInts1 [0] < 1) {arrayOfInts1 [0] = X;}

                  } else if ((X > 24) && (X < 76)) {
                        X = 50;    if (arrayOfInts1 [1] > 1) {arrayOfInts1 [1] = 0;}
                 else if (arrayOfInts1 [1] < 1) {arrayOfInts1 [1] = X;}

                  } else if ((X > 49) && (X < 101)) {
                        X = 75;
                if (arrayOfInts1 [2] > 1) {arrayOfInts1 [2] = 0;}
                 else if (arrayOfInts1 [2] < 1) {arrayOfInts1 [2] = X;}

                  } else if ((X > 74) && (X < 126)) {
                        X = 100;
                 if (arrayOfInts1 [3] > 1) {arrayOfInts1 [3] = 0;}
                 else if (arrayOfInts1 [3] < 1) {arrayOfInts1 [3] = X;}

                  } else if ((X > 99) && (X < 151))  {
                        X = 125;
                if (arrayOfInts1 [4] > 1) {arrayOfInts1 [4] = 0;}
                 else if (arrayOfInts1 [4] < 1) {arrayOfInts1 [4] = X;}

                  } else if ((X > 124) && (X < 176)) {
                        X = 150;    if (arrayOfInts1 [5] > 1) {arrayOfInts1 [5] = 0;}
                 else if (arrayOfInts1 [5] < 1) {arrayOfInts1 [5] = X;}

                  } else if ((X > 149) && (X < 201)) {
                        X = 175;
                if (arrayOfInts1 [6] > 1) {arrayOfInts1 [6] = 0;}
                 else if (arrayOfInts1 [6] < 1) {arrayOfInts1 [6] = X;}

                  } else if ((X > 174) && (X < 226)) {
                        X = 200;
                 if (arrayOfInts1 [7] > 1) {arrayOfInts1 [7] = 0;}
                 else if (arrayOfInts1 [7] < 1) {arrayOfInts1 [7] = X;}

                  } else if (X > 199 && (X < 251)) {
                        X = 225;
                if (arrayOfInts1 [8] > 1) {arrayOfInts1 [8] = 0;}
                 else if (arrayOfInts1 [8] < 1) {arrayOfInts1 [8] = X;}

                  } else if ((X > 224) && (X < 276)) {
                        X = 250;
                if (arrayOfInts1 [9] > 1) {arrayOfInts1 [9] = 0;}
                 else if (arrayOfInts1 [9] < 1) {arrayOfInts1 [9] = X;}

                  } else if ((X > 249) && (X < 301)) {
                        X = 275;
                if (arrayOfInts1 [10] > 1) {arrayOfInts1 [10] = 0;}
                 else if (arrayOfInts1 [10] < 1) {arrayOfInts1 [10] = X;}

                  } else if ((X > 274) && (X < 326)) {
                        X = 300;
                 if (arrayOfInts1 [11] > 1) {arrayOfInts1 [11] = 0;}
                 else if (arrayOfInts1 [11] < 1) {arrayOfInts1 [11] = X;}

                  } else if ((X > 299) && (X < 351)) {
                        X = 325;
                if (arrayOfInts1 [12] > 1) {arrayOfInts1 [12] = 0;}
                 else if (arrayOfInts1 [12] < 1) {arrayOfInts1 [12] = X;}

                  } else if ((X > 324) && (X < 376)) {
                        X = 350;
                if (arrayOfInts1 [13] > 1) {arrayOfInts1 [13] = 0;}
                 else if (arrayOfInts1 [13] < 1) {arrayOfInts1 [13] = X;}

                  } else if ((X > 349) && (X < 401)) {
                        X = 375;
                if (arrayOfInts1 [14] > 1) {arrayOfInts1 [14] = 0;}
                 else if (arrayOfInts1 [14] < 1) {arrayOfInts1 [14] = X;}

                  } else if ((X > 374) && (X < 426)) {
                        X = 400;
                 if (arrayOfInts1 [15] > 1) {arrayOfInts1 [15] = 0;}
                 else if (arrayOfInts1 [15] < 1) {arrayOfInts1 [15] = X;}

                  } else if ((X > 399) && ( X < 451)) {
                        X = 425;
                if (arrayOfInts1 [16] > 1) {arrayOfInts1 [16] = 0;}
                 else if (arrayOfInts1 [16] < 1) {arrayOfInts1 [16] = X;}
            }

                  for (int c = 0; c < k - 1; c++) {
                        if (arrayOfInts1[c] > 0) {
                              g.drawImage(imageBG2,arrayOfInts1[c],5,25,98, this);
                              System.out.println(c + 1 + " " + arrayOfInts1[c + 1]);
                        }
                  }
            }

      }
}




Delphi3
LVL 4
delphi3Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
heyhey_Connect With a Mentor Commented:
you can delete the question now :)

> Yes there is a blue applet area.

you have to install JDK 1.1 and configure Kawa to use it.
0
 
heyhey_Commented:
print the image sizes after they are "loaded"

System.out.println("" + imageBG1.getWidth(null));
0
 
delphi3Author Commented:
heyhey,
I placed it here
     } catch (Exception e) {
               mt = null;
               System.out.println("Could not do image!");
               imageBG1 = null;
               imageBG2 = null;
          }

                System.out.println("" + imageBG1.getWidth(null));


is that where you intended I should add it?

Delphi3
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
delphi3Author Commented:
heyhey.
The comment you provided was of no use to me.
Sorry.
What I discoverd on my own was that this line
        if (clickPoint != null) {
                                int X = (int)clickPoint.getX();
should have been:
 
        if (clickPoint != null) {
                                int X = (int)clickPoint.x();


I appreciate you answering and maybe in the future we can connect so that points can come your way

Thanks again.

Delphi3
0
 
delphi3Author Commented:
The solution provided was of no value to me and others could have commented but did not.

I showed the person my solution and thanked him accordingly.

Delphi3
0
 
heyhey_Commented:
thanks for the points !
0
 
delphi3Author Commented:
heyhey,

But I realized before the delete, what is here is on value to someone else.  So I changed my mind.  Saved it for the record.  The points are yours.  Thanks  for stopping by.


Have a good day and thanks again.
Delphi3
0
 
heyhey_Commented:
thanks for the points !
0
 
heyhey_Commented:
thanks for the points !
0
 
heyhey_Commented:
ooops, stupid browsers :(
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.