Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java checkbox selection
Hello everyone. I am developing my project. I am using checkboxes, combobox and a button. I select an item from combobox let me say it is Prof DR JOHN NHOJ and I am clicking more than one check boxes. For example barcelona, apple, NYC and bus are ticked for Prof DR JOHN NHOJ. I am clicking save button. Until here everything is Ok. However for the second try. I want to disable barcelona apple, NYC and bus checboxes. For example I will chose another person from combobox and I will assign Real Madrid; grapes; RI, train for this person. I don't want to see barcelona, apple, NYC and bus checkboxes enabled. Is there any solution ?
Posted 30-Jul-12 3:40am
FoxRoot896
Comments
jeyamothi at 30-Jul-12 8:43am
   
i am not getting you properly can you give me example design for your question
TuranEmre at 30-Jul-12 9:14am
   
Thank tou jeyamothi. I did it. Next time I will give SS.
TorstenH. at 30-Jul-12 10:26am
   
I can recommend to create a data facade for this. Otherwise you will loose it.
TuranEmre at 30-Jul-12 10:31am
   
I will connect this application to Oracle. I will keep all the information. Today I am just doing the visual part of project and some buttons. Thanks TorstenH.
TorstenH. at 30-Jul-12 10:35am
   
I did not think of a database.
I'm talking about a client sided facade to hold the data.
To split it from GUI. to keep it organized.
TuranEmre at 30-Jul-12 10:40am
   
Oh my fault you are right. I should do that. Thank you TorsentH. You helped me too much today.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

if(checkboxname.isSelected())
checkboxname.setEnabled(false);

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

Solution 2

Yes, possible. Just filter the previous already selected items from the datasource itself.
 
Two ways:
1. If you are fetching data for every person then you can do the filtration at query level.
2. If you are fetching data once and using again & again, you need to write your own logic for already selected data removal from full set.
 
Try out!
  Permalink  
Comments
TuranEmre at 30-Jul-12 10:01am
   
thank you. I will try both ways.

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

  Print Answers RSS
0 OriginalGriff 6,803
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,421
3 Manas Bhardwaj 4,841
4 Maciej Los 4,330


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 30 Jul 2012
Copyright © CodeProject, 1999-2014
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