May be somebody need to create a nice UI library for Blackberry. Shouldn’t be that hard. We are ready to pay for it(if reasonably priced) .
Like everyone else, we had to build our own but it is very specific to our application. For example, here is a little ImageButton we created ( having an image button solves half teh look-and-feel problems)
Code:
public class ImageButton extends BitmapField
{
private static final Bitmap focusOverlayBitmap = Bitmap.getBitmapResource("overlay.png");
String name;
String title;
ImageButtonListener eventListener;
boolean hasFocus = false;
public ImageButton(String name, String title, String imageName)
{
super(focusOverlayBitmap,Field.FOCUSABLE);
Bitmap bitmap = Bitmap.getBitmapResource(imageName);
setBitmap(bitmap);
this.name = name;
this.title = title;
}
public ImageButton(String name, String title)
{
this(name, title,name + ".png");
}
protected void onFocus(int direction)
{
hasFocus = true;
invalidate();
}
protected void onUnfocus()
{
hasFocus = false;
invalidate();
}
protected void paint(Graphics graphics)
{
super.paint(graphics);
if (hasFocus)
{
graphics.drawBitmap(0, 0, focusOverlayBitmap .getWidth(), focusOverlayBitmap .getHeight(), focusOverlayBitmap , 0, 0);
}
}
protected boolean navigationClick(int i, int i1)
{
if (eventListener==null) return false;
return eventListener.imageButtonClicked(this);
}
public String getName()
{
return name;
}
public String getTitle()
{
return title;
}
public ImageButtonListener getEventListener()
{
return eventListener;
}
public void setEventListener(ImageButtonListener eventListener)
{
this.eventListener = eventListener;
this.setFocusListener(eventListener);
}
}