• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Layout Managers

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPanels and Applets have FlowLayout as their default Layouts and Frames have BorderLayout as their default Layout .
Please correct me if i am wrong .
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Possibly the best answer to your question is found by writing a quick test program.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are absolutely right!!!
 
nupur dhawan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:'

 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
uwais,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic