Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java J2ME Blackberry
Is there any way to add grid view in blackberry, plz help me for this
Posted 11-Sep-12 23:32pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Below code helps you to create grid view :-
 
public final class gridFieldDemoScreen extends MainScreen
{
	LabelField one, two, three, four, five, six;
	public gridFieldDemoScreen()
    {
        setTitle("gridFieldDemo");   
        GridFieldManager grid = new GridFieldManager(2, 3, 0); // add number of rows and columns you want in ur grid i.e in this i take row = 2 and column = 3
        one = new LabelField("ONE");
        grid.insert(one, 0);  // this statement will add text to the grid and 0 is for position means index position of a text
        two = new LabelField("TWO");
        grid.insert(two , 1);
        three = new LabelField("THREE");
        grid.insert(three, 2);
        four = new LabelField("FOUR");
        grid.insert(four, 3);
        five = new LabelField("FIVE");
        grid.insert(five, 4);
        six = new LabelField("SIX");
        grid.insert(six, 5);
        grid.setColumnPadding(20); // this will use for gap between one grid element to other
        grid.setRowPadding(20);
        add(grid); // this will add grid to the screen
    }
}
  Permalink  
v2
Comments
amanarora BB at 12-Sep-12 4:40am
   
may be this code not works on simulator so try to use it on your device
Joan Murt at 12-Sep-12 4:44am
   
6 minutes of difference between the question and the answer... apart of that completely non documented neither explained.
Joan Murt at 12-Sep-12 4:45am
   
Oh, and we can't test (we don't want to) into our simulator and we have to do it directly on our device... If you want to post tips and tricks, there's a section for doing that, this area is to ask real questions to real problems.
amanarora BB at 12-Sep-12 4:50am
   
i am trying that code on system, but when i tried that on device that works, thats why 6 mins difference is there..
Joan Murt at 12-Sep-12 4:53am
   
You are posting questions and after less than nothing the answers... this is possible once, but not as often like you are doing, you are posting incomplete/unclear questions and then a code dump. This is not how you should do it, if you've solved it for yourself then add a correct explanation, if not, delete the question, you are making CP quality to go low by doing that, this is why you are getting downvoted. If you want to explain the users how to do something (which is what it seems) then you should not add a question, you should start with tips and tricks, probably it will be well received. Posting a small introduction and some information on how to achieve things and why you've reached that conclusion...
amanarora BB at 12-Sep-12 4:50am
   
on simulator its giving exception
Joan Murt at 12-Sep-12 4:57am
   
please, see that just at the right area of each message there are some buttons (one of them is the reply one) use that if you want to reply to any user...
I don't know other members, but I've just came here to try to help, not to learn anything, then I've found a code dump from somebody that said that did not know how to do it and suddenly an answer from that same person saying that it would not work on the simulator, and that we have to use our phone... I'm not willing to do that... and I guess nobody will.
amanarora BB at 12-Sep-12 5:01am
   
now i am giving the explanation is this explanation is enough
Joan Murt at 12-Sep-12 5:03am
   
Do you understand that you are using !Questions & answers" in a wrong way? you should be using the "tips & tricks" CP area... Putting some comments to a code dump doesn't conforms a good answer...
amanarora BB at 12-Sep-12 5:06am
   
i will kept that in mind, but i have problem before in that because its not working, now if it start working in 6 mins that become a tips not a question.

but before 6 mins this is a problem for me thats why i ask it
Joan Murt at 12-Sep-12 5:09am
   
pasting the question (incomplete) writting 24 +/- code lines test them and see they work... all in 6 minutes... for me it is not a good example of I've tried something hard and after searching on my own I've seen that I can't solve it so after trying this and that I'm posting this question here to receive help... to me this is more like how can I do 2+2? think for half a second and then oh yes! I've got the answer... X|
amanarora BB at 12-Sep-12 5:17am
   
and this site is meant for all kind of users, all are having a different preception so no one works like u have. i appreciate your point but talk like a professional dude
Joan Murt at 12-Sep-12 5:27am
   
OK, you've been here for less than a month and I'm not speaking as a professional...
I will not spend more time on that. If you continue getting downvoted by everyone soon you'll be out of Codeproject... It's your problem if you don't want to receive advice.
stib_markc at 12-Sep-12 5:31am
   
Just in 6 mins you understood how to code for a grid view in Blackberry? Or did you find the code somewhere else(which is good). But one of the guidelines for posting a question is : please use google or any other search engine, if you cannot find anything there also, or if you have problem searching with google, then you can ask here with some specificity about your problem.
amanarora BB at 12-Sep-12 5:11am
   
so u should answer that in 6 minutes den
Sahil Mahajan Mj at 12-Sep-12 8:02am
   
angrejo bharat chhodo.
Sahil Mahajan Mj at 12-Sep-12 8:04am
   
Hello everyone, indians are too smart. they can solve any problem in less than a minute. Though 6 minutes are far more than enough to solve a problem like this. Dont you dare think that, only you have the potential to solve an issue, we indians are a step superior than you.
Sahil Mahajan Mj at 12-Sep-12 8:06am
   
Vande Mataram.
Bharat mata ki jai..
hmara hindustan zindabad tha, zindabaad hai or zindabaad rhega.
dood maangoge to kheer denge, kashmir maangoge to cheer denge.

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

  Print Answers RSS
0 Mika Wendelius 161
1 Abhinav S 115
2 Kornfeld Eliyahu Peter 100
3 Suvendu Shekhar Giri 100
4 Peter Leow 100
0 Sergey Alexandrovich Kryukov 8,513
1 OriginalGriff 6,526
2 Peter Leow 3,657
3 Zoltán Zörgő 3,426
4 Richard MacCutchan 2,417


Advertise | Privacy | Mobile
Web03 | 2.8.150123.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100