• Post Reply Bookmark Topic Watch Topic
  • New Topic

cell selections in JTable

 
Eli Daum
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking to fire off a ListSelectionEvent for every cell selected in the JTable. Right now If you click on a cell and subsequently click on another cell in the same row it will not fire off the event. I have tried using almost all combinations of the following methods:
table.setColumnSelectionAllowed(false);
table.setRowSelectionAllowed(false);
table.setCellSelectionEnabled(true);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
could someone please tell me where I am going wrong???
Thanx Eli Daum
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe these sites can help you:
(a single cell can only be selected if column _and_ row selection is allowed)
http://javaalmanac.com/egs/javax.swing.table/SelRowCol.html
http://javaalmanac.com/egs/javax.swing.table/GetSel.html?l=rel
section 18.1.17 in:
http://developer.java.sun.com/developer/Books/swing2/chapter18-03.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!