Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JAVA applet "display area" fix - how to do it?  RSS feed

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I am working my way through GUI programming and find myself frustrated about not being able to fix a screens dimensions (yet)

So far I have figured out that:
1. "The screensize" of an applet can be regulated from the HTML code that launches the applet. The parameter width and height determine how big the "applet screen area" is going to be "on screen in the browser" of the client. (see example below)


Question:
How can I determine/fix the surface_area of an applet (from inside the applet via code)
 
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't change the size in code, but you can call getSize() to find out what it is.
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't mind a somewhat hackish solution, then it's possible to do this from within JavaScript code .

And since it is possible to access the web page's DOM through the Common DOM API, it should be possible that the applet resizes itself that way. I'm not sure if you can call JavaScript this way, but it should be possible to access and alter the width/height properties mentioned in the article above.
 
Sheriff
Posts: 21185
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our Applet forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!