Dear J2ME Experts,
I have written a subclass of CustomItem named MyCustomItem.
I want to add the object of this class to myForm (Form object) so that added MyCustomItem object is maximally horizontally and vertically expanded.
Of course, this MyCustomItem object would be the only item on this form.
This is the code sample that I used:
MyCustomItem myitem = new MyCustomItem();
myItem.setLayout(Item.LAYO
UT_EXPAND | Item.LAYOUT_VEXPAND);
MyForm myform = new MyForm();
myform.append(myitem);
The problem is that getPrefContentWidth() and getPrefContentHeight() methods of MyCustomItem must be overrided, and it is obvious that J2ME LayoutManager uses this values to calculate dimensions of myitem, and ignores my requests for expanding.
Of course, now, in the code-writting time I don't know user-screen dimensions so I can't return valid values from this methods.
I would really appreciate any help on this subject,
Thank you in advance,
Uros Vidojevic
Start Free Trial