JTable cell selection event

D

Don

Greetings,

I have an application that uses a JTable. When the user changes the
value in one of the cells and moves to another cell (with either the
mouse or keyboard), I want to do something with the new value of the
changed cell, any idea how I can capture this event?

Thanks in advance,
Don
 
S

Svetozar Radojcin

I am not sure, but try to play with
JTable.editingStopped() - or -
JTable.getCellEditor().addCellEditorListener(....)

-regards...
 
S

Srdjan Skrbic

You must implement this method (in table model):
public void setValueAt(Object val, int row, int col) !
Whenever user exits the cell, this method is called.
Does it works?

Srdjan.
 
J

JavaGuru

D

Don

Thanks Liz,

That sounds like just the job - I'm new to Swing, and coming from a
Delphi backgound (all bow), I find it frustratingly difficult to
accomplish what ought to fairly straightforward tasks such as this.

Thanks Again,
Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top