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 the relationship between clipping and repainting?
What is the use of jfc in java swing?
Why swing components are called lightweight components?
What is the difference between a scrollbar and a jscrollpane ?
What is a component in swing?
What are the advantage of swing over awt?
What is double buffering ?
What is import javax swing jframe?
What are the components of swing in java?
What is swing gui in java?
Which method is used for setting security in applets?
What is the function of lightweight components used in swing?
What is an event and what are the models available for event handling?
What is the base class for all swing components?
What is swing in java javatpoint?