File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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

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)

How can I determine/fix the surface_area of an applet (from inside the applet via code)
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

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

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

Joined: Oct 27, 2005
Posts: 20193

Moving to our Applet forum.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: JAVA applet "display area" fix - how to do it?
It's not a secret anymore!