Symbian
Symbian OS Library

FAQ-0709 My UIQ components appear under the MenuBar. Why?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: AWT
Created: 05/21/2001 Modified: 06/25/2001
Number: FAQ-0709
Platform: Not Applicable

Question:
When I use a null layout in UIQ, some of my UI components get positioned under the MenuBar. Why is this and what can
I do about it?


Answer:
This is a known issue with the way the rectangular region allocated to a Frame is assigned in UIQ. The calculation is done when pack() is called on the Frame. In UIQ, pack() should therefore always be called, but not before adding a MenuBar.

In most cases the LayoutManager does the right thing irrespecive of when it is set. But a null Layout is a special case in that you need, somewhat counterintuitively, to call pack() after addMenuBar() but before setLayout(null) for the correct size and position of the Frame to be recognised during the layout process. Otherwise the positions of UI components will be assigned as though there were no MenuBar.