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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Swing / AWT / SWT
Href in Jtable(or similar action)
surya naidu
Ranch Hand
Posts: 32
posted 12 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
Marshal
Posts: 28193
95
I like...
posted 12 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 12 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); } });
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JTable
complex JTable cell mouseover issue
jtable
JTable
JTable(!!!)
More...