The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes LayoutManager2 interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "LayoutManager2 interface" Watch "LayoutManager2 interface" New topic

LayoutManager2 interface

swapna sivaraju
Ranch Hand

Joined: Jan 18, 2002
Posts: 75
HI guys
I wanted to know which all layoutmangers
implement LayoutManager2 interface as
in one of the tutorial on net it says "only
BoxLayout implements it" but RHE says GridBagLayout ,BoxLayout,BorderLayout and CardLayout implement it.

Rob Ross

Joined: Jan 07, 2002
Posts: 2205
LayoutManager2 understands the concept of "constraints"; these are extra paramaters you provide when you add a component to a container. Any layout manager that takes a constraint as a paramater will be implementing the LayoutManager2.
I'm not really clear what your real question is, since you seem to have answered it yourself. Look at the JavaDocs for LayoutManager2, and you will see the classes that implement it. Of the Layout Managers you should know for the test, they are: BorderLayout, BoxLayout, CardLayout, GridBagLayout.
In fact, the only required layout manager I know of that doesn't implement LayoutManager2 is FlowLayout.

SCJP 1.4
Matt Ghiold
Ranch Hand

Joined: Feb 24, 2002
Posts: 213
I am slighly confused, I though box layout was a part of swing and therefore not part of the exam.
Can someone please verify that I should be studying the box layout as well.

-Matt<br /> SCJP2<br /> SCJD
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
That's right Matt,
BoxLayout is a member of the javax.swing package, and thus, is not part of the objectives...

[Blog] [Blogroll] [My Reviews] My Linked In
Matt Ghiold
Ranch Hand

Joined: Feb 24, 2002
Posts: 213
Thanks Valentin, I was scared there for a second...
Off to Operators and Assignment work =)
I agree. Here's the link:
subject: LayoutManager2 interface
It's not a secret anymore!