This fix my problem... Guys thanks a lot to your assistance... I learned a lot from your suggestion...
public void valueChanged(ListSelectionEvent e) {
if(!e.getValueIsAdjusting()) {
//tableModel.getValueAt(messageTbl.getSelectedRow(),col)
}else{
tableModel.getValueAt(messageTbl.getSelectedRow(),col)
}
}
Prescott, Ralph wrote:

>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, January 15, 2003 1:33 AM
>To: Ruel Elvambuena
>Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
>[EMAIL PROTECTED]; Vikram Kumar
>Subject: Re: JTable display problem
>
>[snip]
>Later on if u want to delete a selected row.. follow these ...
>
>1. Get the model from the table ( (DefaultTableModel)table.getModel())
>2. Get the data vector from model and delete the row -
>tableModel.getDataVector().remove(messageTbl.getSelectedRow());
>3. Fire the data changed event - tableModel.fireTableDataChanged();

Step 3 (firing the change notification) is really the responsibility
of the model not the user of the model. If you are using DefaultTableModel
it's already done in the removeRow method. If you implement your own
TableModel implementation you should fire the events in your model's mutation
methods.

So a minor change:
(DefaultTableModel) table.getModel()).removeRow(table.getSelectedRow())

~rmp

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing


Reply via email to