Meaningless Drivel is fun!*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 39535
    
  27
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


Ping & DNS - updated with new look and Ping home screen widget
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: animation question: resize applet?
 
Similar Threads
YoYo goes up and down on a string but the yoyo doll doesn't display it appears broken in Internet Ex
Start: applet not initialized
Compatibility issues with my applet and label color.
Ladders and slides
Start: Applet not initialized