• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

animation question: resize applet?

 
f. nikita thomas
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,
the issue with the following code is this:

i'm using eclipse to run it with the applet viewer. when the applet first opens i can see the upper portion of the animation correctly; however if i resize the frame all i see is the arms and legs ...

i tried putting this in a webpage but it failed, and i don't know html, <don't laugh>, enough to correct the problem there.

any help will ...



thanks in advance ...
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't looked at the code, but resizing is not an option for applets. They have a fixed size that can't be changed once they're part of an HTML page.

The Applet FAQ points to the Java Tutorial section on applet tags in HTML: http://faq.javaranch.com/java/AppletsFaq#tag
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually applets can be resized, but it involves JavaScript. I have used the following quite successfully:


This even works with applets defined in an <object> HTML element.

You have to call it in the HTML body's onLoad and onResize events.
[ September 28, 2008: Message edited by: Rob Prime ]
 
f. nikita thomas
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow, moved again...

anyway i have a partial solution to my problem. added these lines to my paint() method.



this is an example that my instructor gave us. it just made sense to redraw the head and trunk again. now i'm still stuck on why the background color doesn't resize with the frame(white where cyan ought to be), and of course the failure of the class to initialize in webpage<ie,mozilla,konqueror> again any help will ...

thanks again.

n
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic