Will cause a compilation error – a Layout cannot be set after a component has been added with a preset Layout Manager.

Will cause a Runtime Exception – a Layout cannot be set after a component has been added with a preset Layout Manager.

Will compile cleanly and throw no runtime Exception. Only the button with label “Center” is visible and occupies the whole screen.

Will compile cleanly an throw no runtime Exception. All the buttons are arranged in a single line. Any other component added in future will follow the rules of the BorderLayout Manager.

Will compile and run cleanly, but no component is visible.

Will compile cleanly and throw no runtime Exception. The buttons are arranged as listed below.

Button Label

Position

Center

Center

North

North

South

South

East

East

West

West

40 . A frame uses BorderLayout Management and has components added to all the regions. One resizing the Frame Some space becomes available. The space is alloted to the regions, in which Order of preference?

Related posts:

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

About Us

Javabeat.net is a blog dedicated to Java/J2EE developers. This site focus on beginners and advanced developers. We constantly write fresh content on J2EE topics like Spring, Hibernate and wide variety of J2EE frameworks.