• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

animation question: resize applet?

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ...
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic