• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with Applets in HTML Document

 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm (like the subject says) having problems inserting applets into my html document and getting some of them to work. Some work just fine, but a couple don't work. One that doesn't work uses Graphics2D objects and the other uses swing components, maybe this is the problem? Will only Netscape 6 support swing? And what about the other one that doesn't use swing at all? Any suggestions would be great, if you want to see what I mean, go to http://www.geocities.com/mjbruesch . Bear in mind, I wrote the HTML code myself, so it's nothing fancy. Comments are greatly appreciated!
 
mayur sangoi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
well, i would like to suggest you that while checking any applet in you browser keep your java consol enable so if there any error in class it will show you in consol and about graphic2d and swing , let me tell you that IE 4.0 and above does support jdk1.1 only
where netscape its fully java enabled.

regards,
Mayur
[This message has been edited by mayur sangoi (edited October 02, 2001).]
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the prompt reply Mayur. As much as I hate Netscape, I may download it just to make sure everything is working properly for some people in my webpage.
Thanks again!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can install the java plugin to allow your browser to use the newer versions of java
http://java.sun.com/products/plugin/1.3/docs/quick_start.html
The older versions of Netscape require this also.
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the link Cindy, plug-in installed. But then anyone who views my webpage will need their own plug-in, correct? And I have another question now.....
I made an applet that constructs a clock with the time and date. It runs on it's own thread that repaints itself every 100 milliseconds so it keeps up with the current time. The problem is the dern thing keeps flickering every couple of seconds, it's very annoying. Is there any way to stop this flickering? Someone said something to me about overriding some applet method, but I don't know which one. Forgive me if this is a dumb question, I'm a newbie. Thanks! :P
 
mayur sangoi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi michael
Call your paint method inside update method
i.e
public void update(Graphics g)
{
paint(g);
}
if it does not get solve
send me your code
regards,
Mayur
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Mayur for your replies. I did as you suggested, and it did cut down greatly on the flickering, but it still flickers a little bit every couple of seconds. I'll e-mail you the code, maybe you can help more if you see what I see. And thanks again for your help!
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, your e-mail address is not in your profile. E-mail me with your address and I'll send you the code. Thanks Mayur. mjbruesch@hotmail.com
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can solve this problem using double buffering.
Do a search (the link under the two buttons above) on the "Applets" forum for flicker and you will find several good conversations with examples.
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tip Cindy, I found a great link to an explanation of double buffering. I'm gonna try it out. I should've posted this in the applet forum, didn't even know it was there. Thanks again Cindy!
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Outstanding, it works absolutely perfectly. I even lowered the thread sleeping time to 50 instead of 100 milliseconds, and with the double buffering, not even a single flicker. I love when I actually get things to work . Thanks Cindy, and thanks Mayur for your suggestions as well. If you want to see the new code still, lemme know. If you want to see my non-flickering clock, go to http://www.geocities.com/mjbruesch . Yeehaw!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
mayur sangoi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey
Thats coool
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, this is goofy, but I had to add one more reply so that my topic would get a flaming folder icon for having more than 12 responses. Woohoo! I'm a java master.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic