permaculture playing cards*
The moose likes Beginning Java and the fly likes Problems with Applets in HTML Document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problems with Applets in HTML Document" Watch "Problems with Applets in HTML Document" New topic
Author

Problems with Applets in HTML Document

Michael Bruesch
Ranch Hand

Joined: Sep 23, 2001
Posts: 158
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!


Michael J Bruesch<br /><i>I code, therefore I am.</i>
mayur sangoi
Greenhorn

Joined: Sep 23, 2001
Posts: 3
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

Joined: Sep 23, 2001
Posts: 158
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

Joined: Sep 29, 2000
Posts: 8521
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.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Michael Bruesch
Ranch Hand

Joined: Sep 23, 2001
Posts: 158
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

Joined: Sep 23, 2001
Posts: 3
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

Joined: Sep 23, 2001
Posts: 158
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

Joined: Sep 23, 2001
Posts: 158
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

Joined: Sep 29, 2000
Posts: 8521
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

Joined: Sep 23, 2001
Posts: 158
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

Joined: Sep 23, 2001
Posts: 158
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

Joined: Sep 29, 2000
Posts: 8521
mayur sangoi
Greenhorn

Joined: Sep 23, 2001
Posts: 3
Hey
Thats coool
Michael Bruesch
Ranch Hand

Joined: Sep 23, 2001
Posts: 158
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problems with Applets in HTML Document
 
Similar Threads
Which IDE's are most used by professionals?
After installing jre 1.3.1, still having problems getting applets to work
Passing Variables from 1 class to another.
UBB code eluding me.....
not working on ie