• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable and events

 
Nathan Paris
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a JTable and would like to know how to capture a selection event. I.e. when the user selects an item in the table I want to be alerted.
Thanks
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/docs/books/tutorial/uiswing/events/listselectionlistener.html
 
erik bunn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about an extension of what Nathan is asking?
Say you need to select a cell (and perform whatever
actions you want), but you do NOT want the mouse
click to be passed to the (cell editor) component
within the cell?
Example: your cell editor is a JComboBox. When you click
on the cell where the drop button would be shown, you want
the unopened list to be displayed first, then let the user
click on the button if he really wants to change things.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic