Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Swing / AWT / SWT
Href in Jtable(or similar action)
surya naidu
Ranch Hand
Posts: 32
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi I have a Jtable which shows a list of users
I have a requirement where i need to be able to click on a username ,I need to capture the username clicked
and then be able to edit the particular users my profile
Can someone help me on how to do this
something like adding a mouse listener on the table....or any other way to do it
(I tried adding a mouse listener to the table but it wouldnt work .or some how i couldnt get it work)
Paul Clapham
Sheriff
Posts: 28371
99
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Usually you just add a selection listener, so that when somebody clicks on a row and thereby selects that row, your listener is notified. The way to do that is a little bit obscure:
JTable table = ... table.getSelectionModel().addListSelectionListener(... your listener goes here ...);
surya naidu
Ranch Hand
Posts: 32
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thank you...I used it like this and got it to work....
ListSelectionModel rowSM = table.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e){ int myRow = table.getSelectedRow(); System.out.println("rowTouched-----"+myRow); } });
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JTable
complex JTable cell mouseover issue
jtable
JTable
JTable(!!!)
More...