您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Content Index

Content Page # 25

Selecting a layout manager

Changing the layout manager for a particular AWT object is straightforward: use the setLayout() method

setLayout should be given the name of a new object of the appropriate layout manager

For example, here is how to create a new Panel and spacify that it has a 'border' layout.

Panel p = new Panel();

P.setLayout (new BorderLayout());

 

Back to top

basicline.gif (170 bytes)