Forums Register Login

how to override width and height params in applet tag

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
How is it with relative width and height of an applet ?
Is it supported by every browser and Java version or not ?
+Pie Number of slices to send: Send
The only cure for that is hours of television radiation. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1099 times.
Similar Threads
Adding a button?
Can not set the stupid size to panel here is the problem!
Yet more swing applet web browser problems
Problem with JDialog and setSize()
Do you always need setVisible?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:21:04.