Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 6
Registered: ‎09-05-2009
My Device: Not Specified

How to create this layout?



I want to start my post mentioning that I am really new to Java, I´m a webdeveloper, so the idea of Java applications is really confusing for me, I'm learning, and manage to create an small app, that barely works so far :smileytongue:


Basically i am trying to something like this:



I need to add as many items (images) to the menu as possible, so i need to scroll to the sides, and the center icon will be a little bigger than the rest, something like the Mac OS X Dock,but not as fancy as it, also, below of each image, there will be an small text label.


Each item will take you to a new screen that will load a normal form, or a RSS reader, i am basing my work on this article by IBM:



But i am totally lost with the menu, so any guide, tutorial, or hopefully sample code will save my Sunday :smileyhappy:


Thanks a lot for your help guys!



Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to create this layout?

I would start with a HorizontalFieldManager to contain the icons. The manager should have horizontal scroll enabled.


The icons should be clickable-focusable BitMapFields. You can set the "normal" image in all fields, then switch the the larger "focus" image in the focused field.




Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: How to create this layout?

There are at least two approaches but first try google confined to blackberry.com for their online dev guides.

You can use the screen,manager, and field and try to put everything together  but it takes a while to find the best

options for each and what you need to customize- I rendered all the javadocs

htmls so I can search it with normal text processing tools ( grep for "field" for example) to find all the classes

that may be relevant. This is good of course to get platform look and feel as much as possible and use

the existing support facilities. 


Alternatively, if you want to insure that your UI looks the same everywhere regardless of how the phone is themed

or otherwise customized, or you anticipate having various overlays that may be difficult to explain to a manager, 

you can just use one large bitmap for your screen and draw stuff where ever you like.

In this case, you just need to get key and navigation actions and move your internal stuff like cursor or focus under 

your own algorithm. The UI components have methods of all of this.  A lot of people seem to have problems with the mangers and

getting the layout as desired, I'm not sure writing your own screen with a list of images and text is really much easier,

versatile, or quicker to learn but it may be an option. This may also mean you have to code something in java that may exist

as faster optimized native code in the existing framework etc.