How to store every column's data in a row in JTable?

removeBtn =new JButton("Remove");

removeBtn.addActionListener(

new ActionListener()

{

publicvoid actionPerformed(ActionEvent ae)

{

{

// int row = table.getSelectedRow();

// int column = table.getSelectedColumn();

// Object data = table.getValueAt(row, column);

tabModel.removeRow(table.getSelectedRow());

}

}

}

);

My JTable has 4 columns, AppointmentID, TimeSlot, Date and Availability.

The above is part of my code to remove a data from a JTable. I have successfully implemented the removing of data, but I also need to remove data from an ArrayList storing all the information.

But for me to remove the data from the ArrayList, I need to pass in 2 attributes, timeSlot, and Date. I am having problem getting this 2 attributes from the table right now.

I think my explaination isn't very clear, but I really don't know how to phrase it properly. I hope anyone reading does understand and offer me some help. If you guys reading don't understand, I'll try my best to explain again. Thank you so much.

Message was edited by:

rhexis

Message was edited by:

rhexis

[1619 byte] By [rhexisa] at [2007-11-26 16:27:04]
# 1
I don't quite follow your question, but I get the feeling that you need to take a look here [url= http://www.iam.ubc.ca/guides/javatut99/uiswing/components/table.html#modelchange]Detecting model changes[/url]
macrules2a at 2007-7-8 22:51:15 > top of Java-index,Desktop,Core GUI APIs...