• Post Reply Bookmark Topic Watch Topic
  • New Topic

Could not be able to perform Action on JTable Cell --> Components  RSS feed

 
karthikraj natarajan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Thanks a lot if i get help...

I have JTable & dynamically rendered the component 2JToggleButton & 1Combobox in one Cell

What am i expecting is: when user clicks on 'Inbox' combobox 'Inbox' should be setSelected(True); & i wanted to load some datas into 'Combobox' for selection

The problem is:
1. i could not be able to get the control on these buttons & combobox to select


NOTE:-
1. i am also using Render for all the columns & mouse selection listerner for 'CheckBox' in the column 0;


Can you please any one help me

Thanks & Regards
Karthik Natarajan
tableWithCompIssue.jpg
[Thumbnail for tableWithCompIssue.jpg]
Find the attachement
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you click 2 (or 3) times, does it then work?
 
karthikraj natarajan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No... i had tried more than one click as well (i had seen post of others where they are facing issue with multiple click to enable)

If you can route me where there is a article something matches with my requirement, it could be helpful for me to try once again.

I had seen most of the article where they rendered only one component, but not something like this

 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Welcome to the Ranch!

I would like to make one point: For getting a checkbox, you don't need to deal with renderers/editors/mouselistener. If the column class is boolean, you can get a checkbox. And then, you can have a table model listener to listen to the value changes. That should reduce some complexity I would think.

Also, your requirement is not clear to me. Let me rephrase: When user selects an item 'Inbox' in the combobox, you want the Inbox JToggleButton to be selected - is that right?
if so, you have also said you want the combobox values itself to be changed. is that the case?

In any case, I would suggest you to create a SSCCE and post the code here. We can try to help from that point.
 
karthikraj natarajan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1st Sorry to posted the code like this...

Darryl Burke... Thanks a lot to routed me to do right way

Please find my requirement

1. CheckBox (Column 0) -- is working fine

My requirement is as follows
1. When i click on 'Inbox' toggle button it has to set to (setSelected(true)) & 'Reference' button should be 'setSelected(false)'
2. at the same time Strings of data s need to be loaded into 'Combobox' and this combobox should be available for user selection

Am i answered correctly for your question? please let me know if your not able to understand....


Please find the code below

1. InboxReferencePanel Class --> Where i have 'INBOX', 'COMBOBOX' & 'Referece' components



2. find the Table Model Created






3. Find the Renderer




4. This is how i am initializing the 'InboxReferencePanel'





Thanks & Regards
Karthik Natarajan
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
karthikraj natarajan wrote:1. i am also using Render for all the columns & mouse selection listerner for 'CheckBox' in the column 0;


1. You need to be accurate in what you post in order to get meaningful help. I can guess 'Render' is probably a renderer but I have no idea what a 'mouse selection listerner' might be.

2. Renderers are not added to any component hierarchy and can't respond to input events. To respond to input, you need a custom editor.

edit: Also, please UseCodeTags <- link

edit2: Go through this link: SSCCE
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!