As a regulation, the lone containers whose layout managers you require to concern about are JPanels and content panes. Every JPanel object is initialized to make use of a FlowLayout, if not you mention another way when creating the JPanel. Content panes make use of BorderLayout by default. If you are not fond of the default layout manager that a panel or content pane uses, you are permitted to modify it to a diverse one. However, if you are not using JToolBar, the FlowLayout and BorderLayout managers are just helpful for prototyping. Any actual application will require to reset the layout manager. Again, you must make use of an suitable tool to do this, rather than coding the manager by yourself.
You can set a panel's layout manager use the JPanel constructor. For example:
Code:
JPanel panel = new JPanel(new BorderLayout());
Bookmarks