Slides0306 - COP 3330 Slides 3/6 Topics Layout Managers...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3330 Slides 3/6
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Topics Layout Managers overview
Image of page 2
Layout Managers This is a general overview of layout managers – lots of detail and help online This is a general overview of pros, cons, so you have broad knowledge Several common ones, several more obscure ones, several very specific ones
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Layout Managers Good for managing GUIs Sometimes flexible and useful – sometimes not Picking the right one is important Layout Managers often have little idiosyncrasies (Javadocs become very helpful)
Image of page 4
General Use 1. Construct a layout manager 2. Configure layout manager 3. Set a component’s layout manager 4. Add things to component (5). Component works with layout manager to figure out where stuff goes Some exceptions to 4 & 5
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
General Use All layouts implement the LayoutManager interface Allows components to simply tell the LayoutManager to “layoutComponents”, and it works
Image of page 6
Hierarchical layouts Hierarchical layouts of different types can be very useful Set layout A on a frame Add a component in that frame Set that component to use layout B Add things to component Very powerful to use simple layout managers like this
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Null Layout Not really a layout component.setLayout(null); Tells component not to mess with your stuff Set exact pixel locations/sizes on individual objects
Image of page 8
Null Layout Example First: component.setLayout(null); Then you can say: button.setLocation(25, 25); button.setSize(25, 25); component.add(button);
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Null Layout Pros
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern