• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JAVA APPLET Surface what is it (technically)?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When creating an "gui" on top of an applet-surface.. most examples i have found - simply start put gui element (on what?) en voila...
Their you have it.. an applet-gui-surface with couple of gui-elements

Question 1: What IS the applet surface actually?
Is it
- a Window?
- a Frame?
- a Panel?
- something else?

Question 2: How can you set (and fix) it height and width? or is this simply not possible?

Thanks for de-mistifying this Applet-Gui-Thing

 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) It's generally a javax.swing.JApplet or a java.applet.Applet; either way, it's ultimately a subclass of java.awt.Panel.

2) You can set the size in the HTML; you can't change it afterwards.
 
Ronald Vermeij
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ernest Friedman-Hill wrote:1) It's generally a javax.swing.JApplet or a java.applet.Applet; either way, it's ultimately a subclass of java.awt.Panel.
2) You can set the size in the HTML; you can't change it afterwards.



Thanks Ernest for clearing this up / confirming my test results!
I have experimented with this "strange applet behavior" and created some 20 (AWT and Swing) little ("hello world") applets (with window, frame or panel as "display-surface"basis) + 20 HTML webpages (with and without the "height" and "width" parameters), just to see how the stuff works, by trail and error :-(.

No Java book (i've ready for far) and online Java applet tutorial mentions this strange feature!

So far I've found of that a (J)Frame has properties to:
- .setSize(w,h) its "display_surface" area to a pre-determined height and width
- .setResizable(true.false) to (dis)allow resizing the "display_surface" area

Note:
Funny thing don't you think that Java has no option to pre-fix a application/applet "display area size"??
Or is this "left out" on purpose because Java is designed as a Multi platform and Multi Operating System Programming Language.???

 
Marshal
Posts: 22449
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to our Applets forum.
 
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic