File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Editing in a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Editing in a JTable" Watch "Editing in a JTable" New topic
Author

Editing in a JTable

Russell Peters
Ranch Hand

Joined: Jan 25, 2006
Posts: 50
I have a JTable with its associated table model and a table model listener. I have 3 columns in it and columns 2 & 3 are editable. When the user edits column 2, I would like to access the new value that the user entered for validation purposes and if valid I update the table else throw an error dialog. I tried the , but this gives me the value that was originally there not the new value.

Currently, I have it implemented as a non editable column and the user clicks the 'Edit' button which shows up a , and therefore I have a handle to the new value.

But now I wish to get rid of the 'Edit' button altogether and make the column editable within the table itself.

Can someone help me with this?

Thanks in advance
[ August 03, 2006: Message edited by: Russell Peters ]

SCJP 1.4
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Russell Peters
Ranch Hand

Joined: Jan 25, 2006
Posts: 50
Worked like a charm !!!


Thanks Craig,

Russell
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Editing in a JTable
 
Similar Threads
JTable
JTable
jtable
JCheckBox in JTable
JCheckBox in JTable not working