JTable
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ASHISH_kothari
Posted On:   Tuesday, July 31, 2001 06:48 AM

How to append variables in JTable & also how to catch the row click in case of JTable?

Re: JTable

Posted By:   Prashanth_Godey  
Posted On:   Wednesday, August 1, 2001 11:04 AM

try this to "catch the row click"...

ListSelectionModel rowSM = table.getSelectionModel();

rowSM.addListSelectionListener(new ListSelectionListener() {

public void valueChanged(ListSelectionEvent e) {

//Ignore extra messages.
if (e.getValueIsAdjusting())
return;

ListSelectionModel lsm =
(ListSelectionModel)e.getSource();

if (lsm.isSelectionEmpty()) {

// System.out.println("no rows are selected");

//no rows are selected
} else {

int selectedRow = lsm.getMinSelectionIndex();

selectRow=selectedRow;
}
}
About | Sitemap | Contact