In the frame program, layout managers are used to implementing several results by using following some layout.
1-floor layout
2 border layout
3 grid-layout and grid bag layout
4 card layout.
Above all the basic layout managers are used for working with some of the layout manager operations layout managers are implemented in a program by using set layout command.
1 Flow layout:-
this is the important term which is responsible for implementing output operations for a particular frame as well as applied in flow layout manager there are following some locations or corner.
1 flow layout. Left
2 flow layout.centre
3 flow layout.right
There are the following constructors that are used.
1 flow layout () :-
this is a default constructor that is used to specify simple flow layout.
2 flow layout ( int how) :-
it is a parameterized constructor it works for specifier how to display or output on-screen either left-right or center.
3 flowlayout ( int how, int horz, int ver) :-
it is a parameterized constructor word for display vertical and horizontal positions.
example:-
set layout (new flowlayout.left) ; set layout ( new flowlayout ( flowlayout center); set layout ( new flowlayout ( flowlayout right));
2 border layout:-
this is a default layout for the windows objects such as frame and window the border layout arrange the components in the five regions four sides as referred to as north, south, east, and West the middle part is called as the centre.
Calling constructor which are used for creating BorderLayout
1 Border layout () :-
It will construct a new border layout with no gaps between the components.
2 border layout ( int int ):-
It will construct a BorderLayout with the specified gaps between the components.
3 Grid layout:-
it represents a layout manager with a specified number of rows and columns in and rectangular grid the container is divided into an equal-sized of rectangles and one of the components is placed in each rectangle.
following constructor which are used
1 Grid layout ()-
It creates a grid layout with a default of one column per component in a single row.
2 grid layout( int rw, int cl) :-
it creates a grid layout with a specified number of rows and columns.
3 Grid layout ( int rw, int cl, int hgap, int vagp) :-
it creates a grid layout with a specified number of rows and columns with a horizontal and vertical gap.
#advantages of layout manager
1 correctly positioned components that are independent of fonts screen resolutions and platform differences.
2 intelligent component placement for containers that are dynamically resized at runtime.
3 ease way of the transaction if a string increases in length after the transaction the associated components a properly aligned.
0 comments:
Post a Comment