• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

resize applet

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!
in order to avoid the grey box while an applet is loading i tried to load it with width and height = 1.
the start() method calls a javascript function, which tries to resize the applet by document.myApplet.height = 222 ...
this works with ie but it doesn't with netscape.
the error message says :"can't access java field width"
does anybody know how to solve this problem ?
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mellowman,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I looked up what you did in Javascript book and it looks like it should work. Maybe you should try using a Component method to resize the applet instead of setting a javascript applet property. Try this?:
document.appletName.setSize(width, height) ;
The javascript book that I'm reading says that either way should work.
 
Clarence Kirby
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, in the applet tag you should have a name paramater:
<applet code="myApplet.class" name="myApplet" width="1" height="1">
</applet>
That might be what's ailing your applet.
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic