aspose file tools*
The moose likes Applets and the fly likes animation question: resize applet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "animation question: resize applet?" Watch "animation question: resize applet?" New topic
Author

animation question: resize applet?

f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
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 ...


Imagination is more important than knowledge "Albert Einstein"
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42942
    
  68
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

Joined: Oct 27, 2005
Posts: 19790
    
  20

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 ]

SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: animation question: resize applet?