• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Gray box where my applet should be

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is most likely a problem with your HTML. Swing can be tricky when it comes to that. Would you care to post your HTML document, or at least the part that references your applet?
-Keith
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi lee,
Please do post your html and the names of images used. I would be interested to analyse your program.
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also guess it's a problem with the JVM of your browser. What does Java Console show you? That should give you some idea abt the error.
- Manish
 
lee gardiner
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
lee gardiner
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?

 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you'd like to determine what version of Java your browsers are using, you could use this code to find out:
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Your mind is under my control .... your will is now mine .... read this tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic