I am new with JAVA. I have started using JTable. I could not understand how to use tablemodel with JTable. Objective is to understand the use of tablemodel.
Asked
Active
Viewed 225 times
-2
-
You should read about the Model-View-Controller paradigm – ControlAltDel Oct 27 '15 at 09:12
-
I know the Model-View-Controller structure paradigm. But I could not understand the use of tablemodel. Can you please help me understand its uses and advantages. – Ankit Kumar Singhal Oct 27 '15 at 09:13
-
See also [*A Swing Architecture Overview*](http://www.oracle.com/technetwork/java/architecture-142923.html). – trashgod Oct 27 '15 at 15:09
1 Answers
1
As it's name suggests... the TableModel is a model for the table. The JTable is a generic utility which can display data from any source. By implementing a concrete TableModel you are giving the JTable all it needs to populate itself.

lance-java
- 25,497
- 4
- 59
- 101
-
-
Can you please share a easy one? Like limitations that are solved by using tablemodel. – Ankit Kumar Singhal Oct 27 '15 at 09:20
-
Without tablemodels, you wouldn't be able to set a model on a JTable. http://docs.oracle.com/javase/6/docs/api/javax/swing/JTable.html#setModel%28javax.swing.table.TableModel%29 – Manu Oct 27 '15 at 09:28
-
What will happen if we do not set ant table model to the JTable? – Ankit Kumar Singhal Oct 27 '15 at 09:29