Canuck2419
Programmer
- May 11, 2009
- 3
I am having a problem extracting data from an editable
cell in a JTable. My test case is initialized with this
code snippet:
<code>
Vector <Vector> vv = new Vector ();
Vector v = new Vector ();
Vector n = new Vector ();
CrewPanel() {
v.add (1);
v.add ("d");
vv.add(v);
n.add("number");
n.add("name");
jTable1.setModel(new DefaultTableModel (vv, n));
}
</code>
With NetBeans I have marked, in the DefaultTableModel
these cells as editable. This seems to work - sort of.
If I set the value in a cell to say "a" and press a button I have installed for convenience, and inspect the dataModel,
there has been no change. OK so now I change another cell to say "b", press the button, and inspect; the first cell
update is now there but not the second. Hmm... now change the first cell to say "aa". Now the update to the second cell is there but not the second update to the first cell.
It appears to be one update behind.
My mind is dim; my spirit vexed - help me please!
Thank you for your time.
cell in a JTable. My test case is initialized with this
code snippet:
<code>
Vector <Vector> vv = new Vector ();
Vector v = new Vector ();
Vector n = new Vector ();
CrewPanel() {
v.add (1);
v.add ("d");
vv.add(v);
n.add("number");
n.add("name");
jTable1.setModel(new DefaultTableModel (vv, n));
}
</code>
With NetBeans I have marked, in the DefaultTableModel
these cells as editable. This seems to work - sort of.
If I set the value in a cell to say "a" and press a button I have installed for convenience, and inspect the dataModel,
there has been no change. OK so now I change another cell to say "b", press the button, and inspect; the first cell
update is now there but not the second. Hmm... now change the first cell to say "aa". Now the update to the second cell is there but not the second update to the first cell.
It appears to be one update behind.
My mind is dim; my spirit vexed - help me please!
Thank you for your time.