• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable Editable column issue.

 
kopparapu v kiran kumar
Ranch Hand
Posts: 32
Chrome Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I have created one JTable. In that Jtable one of the column is editable. I'm able to edit that column. Below this Jtable i have one button to export the table data. While editing this column(still the cursor focus is in the same column) if i click on the export button I'm getting only empty space as the value for that particular column.

After entering the data into that column if i press enter(now the focus is moved to the next row of the table) and after that if i click on export, the data is coming properly.

I'm trying to rectify this issue. Please help me how to solve this issue.



Thanks in Advance,
Kiran Kumar.

 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do love it when people SearchFirst. If you would have done so you might have found this or this thread, or several others like it.
 
Muzaffar Shah Khan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want to make table un-editable, for this when you
write the code JTable table =new JTable(tableModel); simply write this code instead
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Muzaffar Shah Khan wrote:So you want to make table un-editable

No, the editing should stop just before the button's action is executed. Both threads I linked to have a solution for that problem.
 
kopparapu v kiran kumar
Ranch Hand
Posts: 32
Chrome Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Rob,


Thanks for the response. It is working fine.


Thank you very much!!
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!