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 gui?
What are the containers available in swing?
What is the difference between a scrollbar and a jscrollpane ?
Is java swing a framework?
What is difference between awt and swing?
Why are swing components called lightweight components?
What is the function of internal frame in swing?
What is swing in java javatpoint?
How to generate bill in java swing?
How to create a swing gui in java?
What is an event in Swing?
What are swing components?
What is the use of jfc in java swing?
What is the difference between swing and awt?
What is the purpose of transferhandler class?