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 use of double buffering in swings?
How to print in java swing application?
What is the difference between swing and awt in java?
What is the difference between invokeAndWait() and invokeLater()?
What is an on stage swing?
What is import javax swing jframe?
How is parsing html used in swing?
What is java swing gui?
What are the two key features of swing?
How to reload a jframe in java swing?
How does accessibility works in swings?
What is the base class for all swing components?
What is Java Swing?
What is an event in Swing?
Which method of the Component class is used to set the position and size of a component?