Results 1 to 7 of 7

Thread: J2ME CustomItem

  1. #1

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Exclamation J2ME CustomItem

    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..
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: J2ME CustomItem

    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.

  3. #3

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: J2ME CustomItem

    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
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  4. #4
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: J2ME CustomItem

    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.

  5. #5

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: J2ME CustomItem

    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
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  6. #6
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: J2ME CustomItem

    I thought it's possible to do this without needing a reference to the containing Form
    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?

    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.


    Thanks for your help anyway
    No prob buddy, just returning favors.

  7. #7

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: J2ME CustomItem

    Some Items have a layout manager but Custom Items don't. I guess I'd have to do more research on it
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width