• 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

how to override width and height params in applet tag

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I want to set size for applet in init() method, cause its based on some dynamic data.
i tryed resize(), setSize(), setBounds(), nothing is working.
Applet opens always with size defined in html file.
btw in appletviewer everything is working fine with resize() func.
Thx in advance
[ January 27, 2004: Message edited by: Ilja Smoli ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry -- that's just how it works. The web browser lays out the page before your applet is even constructed. By the time init() runs, the page is already displayed, and you can't rearrange it.
 
Ilja Smoli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well, for what all this methods such resize() are?
main idea of applets as i understand to be used in browsers..
[ January 27, 2004: Message edited by: Ilja Smoli ]
 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could display your applet outside of the browser (like in a JFrame) with just a stub panel in the browser that says something like "applet is being shown outside the browser" then you could resize it all you want.
brian
 
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately, Sun used some method names for their own internal functions that all the other windowing systems used for commonly used public functions . I went through a world of grief over that before I finally broke down and bought a decent book on the topic.
Applets are not allowed to resize themselves for several reasons. One of which is that they're not expected to know a whole lot about the overall environment of the windows they live in or what else may be sharing it.
You can get around the problem if you set up a javascript in the web page that is used to get to the actual page containing the applet. Just use the javascript to get the window's current dimensions and pass them to the server and use them to build the applet invocation tags.
It's not a perfect solution, since it can't track window resizing, but it's about as good as you can do.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is it with relative width and height of an applet ?
Is it supported by every browser and Java version or not ?
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See: http://blog.taragana.com/index.php/archive/resizing-applets-dynamically-within-browser-frames/

This works great in IE6
reply
    Bookmark Topic Watch Topic
  • New Topic