Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to override width and height params in applet tag

 
Ilja Smoli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • 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 ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
Brian Pipa
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • 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
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18012
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
Miro Ricco
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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 ?
 
Paul Hilliar
Greenhorn
Posts: 9
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic