The Source for Java Technology Collaboration

Home » java.net Forums » Mobile & Embedded » LWUIT

Thread: CHECKBOX

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 3 - Last Post: Jul 29, 2008 7:08 AM by: chen
elie

Posts: 33
CHECKBOX
Posted: Jul 28, 2008 12:08 AM
 
  Click to reply to this thread Reply

Hello All,

Is it feasable for the new version of LWUIT that developer is able to have the capabilites to add checkboxes to a group like the radiobutton bcz we faced a lot of cases when we have a multiple selection in a group of dynamich choices where we could not create for each choice a checkbox object as per the radiobutton a simple for loop with one radiobutton object and a group can be dynamically created.

thank you

Elie

chen
Re: CHECKBOX
Posted: Jul 28, 2008 3:18 AM   in response to: elie
  Click to reply to this thread Reply

Hi,
Save your dynamic choices in an array or a vector.

Regards,
Chen


lwuit-users@mobileandembedded.org wrote:
> Hello All,
>
> Is it feasable for the new version of LWUIT that developer is able to have the capabilites to add checkboxes to a group like the radiobutton bcz we faced a lot of cases when we have a multiple selection in a group of dynamich choices where we could not create for each choice a checkbox object as per the radiobutton a simple for loop with one radiobutton object and a group can be dynamically created.
>
> thank you
>
> Elie
> [Message sent by forum member 'elie' (elie)]
>
> http://forums.java.net/jive/thread.jspa?messageID=289713
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net


elie

Posts: 33
Re: CHECKBOX
Posted: Jul 29, 2008 3:12 AM   in response to: chen
 
  Click to reply to this thread Reply

Thank you Chen for your reply,

the point that i am talking about is when creating the object and adding it to the form espacially with reference to dynamic issue below is a description of what i meant:

a cehckbox case:

for each choice we should create its own object evaluate for a choice of 200 checkbox :) :
CheckBox firstCB = new CheckBox("First CheckBox");
firstCB.getStyle().setMargin(Component.TOP, 1);
f.addComponent(firstCB);
firstCB.getStyle().setMargin(Component.BOTTOM, 0);
CheckBox secondCB = new CheckBox("Second CheckBox");
secondCB.getStyle().setMargin(0, 5, 2, 2);
f.addComponent(secondCB);

and we should chsk each object alone to get selection otherwise in the case of a radiobutton we create a for loop of 200 count and create one radobutton object and one group ( the group is very important to check selection this is teh main differance with the chackbox)

chen
Re: CHECKBOX
Posted: Jul 29, 2008 7:08 AM   in response to: elie
  Click to reply to this thread Reply

Hi,
If your use case is to show 200 checkbox you should use List object,
adding 200 components to a Container can be expensive.
What you should do is use List and write a renderer that returns
CheckBox in the getListCellRendererComponent method.

Regards,
Chen




lwuit-users@mobileandembedded.org wrote:
> Thank you Chen for your reply,
>
> the point that i am talking about is when creating the object and adding it to the form espacially with reference to dynamic issue below is a description of what i meant:
>
> a cehckbox case:
>
> for each choice we should create its own object evaluate for a choice of 200 checkbox :) :
> CheckBox firstCB = new CheckBox("First CheckBox");
> firstCB.getStyle().setMargin(Component.TOP, 1);
> f.addComponent(firstCB);
> firstCB.getStyle().setMargin(Component.BOTTOM, 0);
> CheckBox secondCB = new CheckBox("Second CheckBox");
> secondCB.getStyle().setMargin(0, 5, 2, 2);
> f.addComponent(secondCB);
>
> and we should chsk each object alone to get selection otherwise in the case of a radiobutton we create a for loop of 200 count and create one radobutton object and one group ( the group is very important to check selection this is teh main differance with the chackbox)
> [Message sent by forum member 'elie' (elie)]
>
> http://forums.java.net/jive/thread.jspa?messageID=290027
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net





 XML java.net RSS