<<< Swing Layouts | Index | Border Layout >>> |
To use a layout manager,
construct the layout, e.g.
new FlowLayout( FlowLayout.CENTER );
pass layout manager object to the JPanel.setLayout() method:
myPanel.setLayout( new FlowLayout( FlowLayout.CENTER ) );
call JPanel.add() method to add UI components:
myPanel.add( myButton );
<<< Swing Layouts | Index | Border Layout >>> |