Hi all,
I'm working on a MIDP 2.0 CustomItem, this item holds a Vector of Images to display...
I was wondering "How can I make the Item fit to the Form?" or Fit to what is left of the form after adding other items (Width and Height)
Thanks..
Printable View
Hi all,
I'm working on a MIDP 2.0 CustomItem, this item holds a Vector of Images to display...
I was wondering "How can I make the Item fit to the Form?" or Fit to what is left of the form after adding other items (Width and Height)
Thanks..
Not sure. I couldn't find any detailed API documents on the subject. Only thing I found was a method called append. I guess you could try and see if you can use setBounds(int, int) with it, but I doubt you can. The only other alternative I can think of, is just make the images the desired width and height beforehand. I'm sure there's a real way of doing this, but I can't find the documentation on the custom controls.
You didn't get me right!
I'm designing the Item, I don't have a reference to the Form..
What I wanna make is a CustomItem that Docks automatically
Sorry.
I don't see how you can get it to dock automatically, though. What you want seems like behavior that is left up to the form, not the control.
I know that
but when you create a TextField, it automatically takes the width of the form... I want my Item to do the same plus take the height of the Form....
I thought it's possible to do this without needing a reference to the containing Form
Thanks for your help anyway :thumb:
See, I don't know anything about the J2ME frame, so I could be wrong about this... Wouldn't the size and positioning of the control depend on the coder of the frame? For instance, you want this control to take the w and h of the form, but isn't that decided by a layout manager or method set in the frame?Quote:
I thought it's possible to do this without needing a reference to the containing Form
I guess you could try taking a reference to the frame as an argument or possibly calling a few super() methods that will alter something, but I just don't see it happening. Again, I don't know much about J2ME so I'm pretty much talking in the wind.
No prob buddy, just returning favors.Quote:
Thanks for your help anyway :thumb:
Some Items have a layout manager but Custom Items don't. I guess I'd have to do more research on it