Author | Topic: List Component.. |
psethura ranch hand |
posted April 08, 2000 03:12 PM
My question: List l = new List(3); But i tried this code and it is not working.. Frame f = new Frame("Fun") All choices are visible. why? Thanks
|
maha anna bartender |
posted April 08, 2000 05:20 PM
psethura, The LayoutManager is the culprit. Can you tell what it does? regds maha anna.
|
psethura ranch hand |
posted April 08, 2000 05:27 PM
Ok here is my understanding... Default layout for frame - BorderLayout .When I add List component frame, it goes to center of borderLayout , N/E/W and South is dicarded. So..it is taking visual properties of Parent container, in this case Frame. Is it correct? If i change to FlowLayout it is working fien..
|
maha anna bartender |
posted April 08, 2000 05:56 PM
Yes. You got it. The reason is BorderLayout doesn't honour (We can say partly honours) the preferred size of the components it contains. I said partly because, it gives the preferred width for East and West side components and preferred height for North and South side components. But for the components placed in 'Center' portion it doesn't care. Because center takes all the left-over from E/W/N/S components. regds maha anna
|
| | |