Page 2 :
1.4 Use of Layout Managers:, , , BorderLayout:, , , , The BorderLayout class implements a common layout, style for top-level windows., , , , It has four narrow, fixed-width components at the edges, and one large area in the center., , , , The four sides are referred to as north, south, east, and, west. The middle area is called the center., , DJ Sir
Page 3 :
1.4 Use of Layout Managers:, , , BorderLayout:, , , , Each region can contain only, , one component and is, identified by a corresponding, constant as NORTH, SOUTH, EAST,WEST, and, CENTER., DJ Sir
Page 4 :
1.4 Use of Layout Managers:, , , BorderLayout:Constructors, , , , BorderLayout( )- The first form creates a default border, layout., , , , BorderLayout(int hGap, int vGap)- This form allows, us to specify the horizontal and vertical space left, between components in hGap and vGap, respectively., , DJ Sir
Page 5 :
1.4 Use of Layout Managers:, , , BorderLayout:, , , , When adding components, we will use these constants, with the add( ) method, which is defined by Container., void add(Component compObj, Object region), , , , Here, compObj is the component to be added, and region, specifies where the component will be added., , DJ Sir
Page 7 :
1.4 Use of Layout Managers:, , , BorderLayout:, , , , The components will be added by using another add(), method also, void add(Component compObj,String region), , Here, compObj is the component to be added, and region, specifies where the component will be added., , DJ Sir
Page 8 :
1.4 Use of Layout Managers:, , , BorderLayout:, , , , The values for the region is as:, , DJ Sir
Page 9 :
1.4 Use of Layout Managers:, , , BorderLayout:, , , , Frame, Dialog, FileDialog, Window and Container has, BorderLayout as default LayoutManager., , , , 0 pixels is the default gap to be maintained between the, components., , DJ Sir
Page 10 :
1.4 Use of Layout Managers:, , , BorderLayout :Example, , DJ Sir
Page 11 :
1.4 Use of Layout Managers:, , , BorderLayout:With Insets, , , , Sometimes we will want to leave a small amount of, space between the container that holds our components, and the window that contains it., , , , For doing this, we have to override the getInsets( ), method that is defined by Container., , DJ Sir
Page 12 :
1.4 Use of Layout Managers:, , , BorderLayout:With Insets, , , , This function returns an Insets object that contains the, top, bottom, left, and right inset to be used when the, container is displayed., , , , These values are used by the layout manager to inset the, components when it lays out the window., , DJ Sir
Page 13 :
1.4 Use of Layout Managers:, , , BorderLayout:With Insets, , , , Constructor of Inset:, Insets(int top, int left, int bottom, int right), , , , The values passed in top, left, bottom, and right specify, the amount of space between the container and its, enclosing window., , DJ Sir
Page 14 :
1.4 Use of Layout Managers:, , , BorderLayout:With Insets, , , , The getInsets( ) method has this general form:, Insets getInsets( ), , , , When overriding this method, we must return a new, Insets object that contains the inset spacing we desire., , DJ Sir
Page 15 :
1.4 Use of Layout Managers:, , , BorderLayout :Example With Insets, , DJ Sir