Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

AWT Containers Help  RSS feed

 
Fitz Herbert
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
Please could you confirm, tell me if I'm wronge a Window is a top level container, the question is can a window contain an applet? Is a Browser a form of window?
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Fitz
JFrame & JApplet are considered as a top level frame that contains some components.
And both of it are subclass of JComponent.
please make a respond if I can not answer clear
 
Fitz Herbert
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Siu
Sorry I'm not using swing, and am not sure if that makes a difference.
The question was more can you add an applet to a window? P.s.Thanks for responding
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes... Applet extends Panel, so you can add it to a Window.

However, you'll need to call applet.init() and applet.start() manually... this is done automatically for you when you run the applet in a browser.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!