The reason i ask about this is the statement i came across while studying from a chapter in 'Thinking in Java' by Bruce Eckel : '. The default layout is used, since JApplet defaults to BorderLayout:'
Nupur. <br />SCJP2.
posted 18 years ago
nupur, If you were to write a quick test applet (using JApplet) you'd quickly discover the correct answer. Also, check the API documentation for JApplet at: http://java.sun.com/j2se/1.4/docs/api/javax/swing/JApplet.html . I strongly suggest that you check the documentation and/or write a quick test program for questions of this nature. Anybody here could accidentally answer the question incorrectly. A test program will seldom lie. With a JApplet, you don't add components directly to the applet (as you do with an Applet). Instead, you have to add the components to the content pane of a JApplet. The default layout of this content pane is in fact BorderLayout. Don't take my word for it. I may have made a mistake.