What is the process of setting the layout manager?

Answer

The layout managers uses Jpanels and content panes to initializes the object that is to be used with the FlowLayout by default and it can be changed by defining a different layout. Content panes uses border layout by default and it uses appropriate tools that can be used to code the appropriate object that has to be used. The panel layout manger can be setup by using the Jpanel constructor and it can be shown by an example given as:

JPanel panel = new JPanel(new BorderLayout());

The setLayout method is used to set the layout manager after the container is being created.

Container contentPane = frame.getContentPane();
contentPane.setLayout(new FlowLayout());

The container's layout property can be changed to NULL to allow the absolute positioning to take place where the specification is given in the form of size and positon of each component that is used inside the container.

All swing Questions

Ask your interview questions on swing

Write Your comment or Questions if you want the answers on swing from swing Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---