Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

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

 
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
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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: 21919
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our Applet forum.
 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic