Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding How to get the Selected Cell values in JTable  RSS feed

 
Vasu mallipeddi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I have one doubt in JTable.

i.e.How to get the Other than Selected Cell values in JTable.

Suppose i select Cell position is, Column 4,Row 7.

I am using below code i am getting the value.It is Fine.


My Issue is,
I am struggling at to get the Other Column Values. I am struggling at how to get those values.

i.e. When ever i select Column 4,Row 7,I need to get the value of Column 1,Row 7 Value and Column 5,Row 7 Value.

Please give me idea. How to proceed from here.

This is urgent.

Thanks,
Vasu
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code. I have added it for you this time. Remember that people here are volunteering their time to help you. So EaseUp.

As for your problem, you should ListSelectionListener to listen for selection events and not mouse events. You can read about Selection Listeners here.

To get a particular cell value, you can use the getValueAt(row, col) method in the JTable.
 
Vasu mallipeddi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Ranganathan ,

For giving of Replay and Code USe Tags thing .

Thanks,
Venkata.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!