Page 2 :
1.4 Use of Layout Managers:, , , Layout Manager:, , , , Layout means the arrangement of components within the, container. In other way we can say that placing the, components at a particular position within the container., , , , The task of layouting the controls is done automatically, by the Layout Manager., , DJ Sir
Page 3 :
1.4 Use of Layout Managers:, , , Layout Manager:, , , , The LayoutManagers are used to arrange components in, a particular manner., , , , If we do not use layout manager then also the, components are positioned by the default layout, manager., , DJ Sir
Page 4 :
1.4 Use of Layout Managers:, , , Layout Manager:, , , , It is possible to layout the controls by manually but it, becomes very difficult because of Two reason; First, It is, very tedious to handle a large number of controls within, the container., , , , Second, the width and height information of a, component is not given when we need to arrange them., , DJ Sir
Page 5 :
1.4 Use of Layout Managers:, , , Layout Manager:, , , , Java provide us with various layout manager to position, the controls., , , , The properties like size, shape and arrangement varies, from one layout manager to other layout manager., , DJ Sir
Page 6 :
1.4 Use of Layout Managers:, , , Layout Manager:, , , , When the size of the applet or the application window, changes the size, shape and arrangement of the, components also changes in response i.e. the layout, managers adapt to the dimensions of appletviewer or the, application window., , DJ Sir
Page 7 :
1.4 Use of Layout Managers:, , , Layout Manager:, , , , The layout manager is associated with every Container, object., , , , LayoutManager is an interface that is implemented by all, the classes of layout managers., , DJ Sir
Page 9 :
1.4 Use of Layout Managers:, , , Layout Manager:, , , , The layout manager is set by the setLayout( ) method. If, no call to setLayout( ) is made, then the default layout, manager is used., , , , Whenever a container is resized (or sized for the first, time), the layout manager is used to position each of the, components within it., , DJ Sir
Page 10 :
1.4 Use of Layout Managers:, , , Layout Manager:, void setLayout(LayoutManager layoutObj), , , , Here, layoutObj is a reference to the desired layout, manager., , DJ Sir
Page 11 :
1.4 Use of Layout Managers:, , , Layout Manager:, , , , If we wish to disable the layout manager and position, components manually, pass null for layoutObj. If we do, this, we will need to determine the shape and position of, each component manually, using the setBounds( ), method defined by Component., , DJ Sir
Page 12 :
1.4 Use of Layout Managers:, , , FlowLayout :, , , , FlowLayout is the default layout manager. This is the, layout manager that the preceding examples have used., , , , FlowLayout implements a simple layout style, which is, similar to how words flow in a text editor., , , , Components are laid out from the upper-left corner, left, to right and top to bottom., , DJ Sir
Page 13 :
1.4 Use of Layout Managers:, , , FlowLayout :, , , , When no more components, fit on a line, the next one, appears on the next line., , , , A small space is left between each component, above and, below, as well as left and right., , DJ Sir
Page 14 :
1.4 Use of Layout Managers:, , , FlowLayout :Constructors, , , , FlowLayout( ) – This creates the default layout, which, centers all the components and leaves five pixels of, space between each component., , , , FlowLayout(int how)- This specify how each line is, aligned., , DJ Sir
Page 15 :
1.4 Use of Layout Managers:, , , FlowLayout :Constructors, , , , Valid values for how:, FlowLayout.LEFT, FlowLayout.CENTER, FlowLayout.RIGHT, , , , These values specify left, center, and right alignment,, respectively., , DJ Sir
Page 16 :
1.4 Use of Layout Managers:, , , FlowLayout :Constructors, , , , FlowLayout(int how, int hGap, int vGap)- This, constructor specify how each line is aligned and also, hGap & vGap is used for horizontal & vertical spaces, between component., , DJ Sir
Page 17 :
1.4 Use of Layout Managers:, , , FlowLayout :Constructors, , DJ Sir