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 disable witing in specific cells in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "disable witing in specific cells in JTable" Watch "disable witing in specific cells in JTable" New topic
Author

disable witing in specific cells in JTable

za sa
Greenhorn

Joined: May 22, 2012
Posts: 1
Hi all;
I am a beginner in programming, and this course I suppose to create Sudoku generator by using java in NetBeans
So far I did the code for generating numbers in a JTable and show the whole solution upon request
But I am straggle in how to disable writing in the visible numbers or the visible cells but enable in the empty cells
I used this code but as it is cleat it disable typing in the whole table

workSheetTable.getCellEditor();

Also I cant think of a way that enables me to get the answer from the empty cells and compare it with the actual solution!!!

Could you help me please in this !
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> But I am straggle in how to disable writing in the visible numbers

for the cells where numbers are supplied by the game you override
table.isCellEditable() to return false, and to return true for the
empty cells. you could also use the model.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: disable witing in specific cells in JTable
 
Similar Threads
Header for JTable
JTABLE
JTable within JTable
JTable...
disabling rows in JTable