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

Regular Contributor
Posts: 77
Registered: ‎06-13-2013
My Device: 9900
My Carrier: blackberry cure

how to add class object in vector + blackberry?

        "settingName": "New",
        "onclick": "CreateNewDoc()"
        "settingName": "Open",
        "settingValue": "OpenDoc()"
        "settingName": "Close",
        "settingValue": "CloseDoc()"

 I am getting data from sever like that.

So I create a class like that


package mypackage;

public class bb_test {
    String settingName;
    String settingValue;
    public String getSettingName() {
        return settingName;
    public void setSettingName(String settingName) {
        this.settingName = settingName;
    public String getSettingValue() {
        return settingValue;
    public void setSettingValue(String settingValue) {
        this.settingValue = settingValue;



I used this example of json

So I am getting json array ?I need to store objects of this bb_test class in vector .can I store the objects in vector ?



Posts: 121
Registered: ‎05-31-2012
My Device: 9900
My Carrier: Airtel

Re: how to add class object in vector + blackberry?

Ofcourse you can add bb_test instance to a vector, as Vector contains objects.


1. Create a new Vector :

Vector vData = new Vector();


2.Add the bb_test instance to Vector.


bb_test obj = new bb_test();



PS: It is always a good practice to follow JAVA naming convention. bb_test should have been named as BbTest or BBTest.

Rishikesh Singh