Answer Posted / narmada
The JTable is used to display and edit regular two-dimensional tables of cells.
The JTable has many facilities that make it possible to customize its rendering and editing but provides defaults for these features so that simple tables can be set up easily. For example, to set up a table with 10 rows and 10 columns of numbers:
TableModel dataModel = new AbstractTableModel() {
public int getColumnCount() { return 10; }
public int getRowCount() { return 10;}
public Object getValueAt(int row, int col) { return new Integer(row*col); }
};
JTable table = new JTable(dataModel);
JScrollPane scrollpane = new JScrollPane(table);
| Is This Answer Correct ? | 10 Yes | 9 No |
Post New Answer View All Answers
What is swing control in java?
What is the use of swing in java?
What are the advantages of swing?
What is the purpose of transferhandler class?
Why swings are called lightweight components?
What is jfc? What are the features of jfc?
What is the difference between invokeAndWait() and invokeLater()?
Who created the swing?
What are the components of swing in java?
What are swing controls?
What are differences between swing and awt?
What is java panel swing?
How to print in java swing application?
Which window contains the swing controls?
Why would you use swingutilities.invokeandwait or swingutilities.invokelater?