Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Every one am newbie to BlackBerry, I was an Android Developer.

Know I would like to create BlackBerry Application using java.

- I want to create Grid Field with image and text I don't know how o create I seen some basic level Grid Field in BlackBerry docs, but its not perfect one that I need please tell me any one,

* How to create Grid Field with Image & text?
* How to create custom grid Field and event handling for each item?

Thanks a ton in advance,

regards.

Murali.
Posted

1 solution

Java
GridFieldManager grid = new GridFieldManager(4 ,4 , 0);
Bitmap msg = Bitmap.getBitmapResource("msg.png");
BitmapField message = new BitmapField(msg, Field.FOCUSABLE)
{
    protected boolean navigationClick(int status,int time)
    {
       label.setText("Messages");
       Dialog.alert("Message icon selected");
       return true;
    }
};
message.setBorder(border);
Bitmap logs = Bitmap.getBitmapResource("calllogs.png");
BitmapField call_logs = new BitmapField(logs, Field.FOCUSABLE)
{
    protected boolean navigationClick(int status,int time)
    {
      label.setText("Call logs");
      Dialog.alert("Call Logs icon selected");
      return true;
    }
};
call_logs.setBorder(border);
grid.add(message, 0);
grid.add(call_logs, 1);
grid.add(contacts, 2);
grid.add(internet, 3);
grid.add(calendar, 4);
grid.setColumnPadding(13);
grid.setRowPadding(13);
add(grid);
message.setFocusListener(this);
call_logs.setFocusListener(this);

if you are using images you can use this else you can use labelfield
Try using this and You can also set focus on it..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900