below is an example of code I'm trying to use in my final project -
When I try to compile it I get an
<identifier> expected resultTable.addMouseListener(new MouseAdapter() {
error (there is a carrot right under the ( before new
I'm sure its me being stupid - please Help? The basic Idea of what I want to acomplish is to have the uer select a row, and then pipe the retrieved data to a textfield.
thanks in advance to anyone that responds
resultTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
// get most recently selected row index
int row = getSelectedRow();
// get most recently selected column index
int column = getSelectedColumn();
if (row == -1 || column == -1)
return; // can't determine selected cell
else {
String stuff =(String) resultTable.getValueat( row, 0);
typeField.setText(stuff);
}
}
});
When I try to compile it I get an
<identifier> expected resultTable.addMouseListener(new MouseAdapter() {
error (there is a carrot right under the ( before new
I'm sure its me being stupid - please Help? The basic Idea of what I want to acomplish is to have the uer select a row, and then pipe the retrieved data to a textfield.
thanks in advance to anyone that responds
resultTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
// get most recently selected row index
int row = getSelectedRow();
// get most recently selected column index
int column = getSelectedColumn();
if (row == -1 || column == -1)
return; // can't determine selected cell
else {
String stuff =(String) resultTable.getValueat( row, 0);
typeField.setText(stuff);
}
}
});