I have developed the following program which allows the user to move a box around the screen. The surface of the box is painted with an image that changes upon every key press to give the impression of movement. This applet works fine in appletviewer but when i try to view it in a web browser such as IE it just comes up as a gray box. I know i have the html code right and the gif images are all in the same folder as the class file so this one has me puzzled. I would be very grateful if someone could look at my code and tell me where the problem is. Many Thanks
[ May 30, 2002: Message edited by: Dirk Schreckmann ]
Thanks for all your reply's as requested my html code is posted below. The names of my gif images are simply a1 to a6.
I have tried this in the latest version of netscape and explorer both show nothing but the gray box. I was thinking maybe some variables are not intialised but if this was the case why is it working in appletviewer. I have tried it on more than one pc, all giving the same results. I have also tried reducing the security settings on my browser to minimum to see if that has any affect, but it does not appear to have. Again i am grateful for any advice you can give me. Lee [ May 31, 2002: Message edited by: Dirk Schreckmann ]
Manish - Could you expand further upon what you where saying about the JVM and the Java Console. I have the latest version of Java, i think, and all my other applets display fine in web pages. I feel a bit silly for asking this question but this is the beginner forum - what is the Java console and how do i access it. I just use dos to compile and edit my programs, is this what you mean by java console. The text books do a good job at teaching you the OOP principles but are not as good on the actual techology you use to run and compile your programs. Thanks for any help. Lee
Originally posted by Dirk Schreckmann: Perhaps your browser doesn't have support for Java beyond version 1.1.8 installed. You may need to install the Java plug-in. Get it here: http://java.sun.com/getjava/ Any luck yet?
Originally posted by lee gardiner: I feel a bit silly for asking this question but this is the beginner forum - what is the Java console and how do i access it. I just use dos to compile and edit my programs, is this what you mean by java console. The text books do a good job at teaching you the OOP principles but are not as good on the actual techology you use to run and compile your programs. Lee
Hi Lee, It's perfectly alright! If you are using IE, you can see java console from "View" menu option -> Java Console. All your System.out.println() (if any) of applet are displayed here. Also, the exceptions are displayed here; which will give you an idea abt what's wrong with your code. If you do not see "Java Console" option in your "View" menu of IE, you'll have to do - Tools |Internet Options |Advanced tab, under Microsoft VM, check "Java Console Enabled" and restart your browser. You should be able to see option "Java Console", in ur "View" menu now. You should also use the code that Dirk gave to determine the JVM of your browser. Though you may have the latest Java on ur machine, the JVM IE uses might be different. Let us know if it helps.. HTH, - Manish