aspose file tools*
The moose likes Applets and the fly likes JAVA applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "JAVA applet "display area" fix - how to do it?" Watch "JAVA applet "display area" fix - how to do it?" New topic
Author

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

Ronald Vermeij
Ranch Hand

Joined: Sep 05, 2009
Posts: 37
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)
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

You can't change the size in code, but you can call getSize() to find out what it is.


[Jess in Action][AskingGoodQuestions]
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
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.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

Moving to our Applet forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Consider Paul's rocket mass heater.
 
subject: JAVA applet "display area" fix - how to do it?