96
GWT GRID
GWT GRID is used to create simple HTML table by extending HTMLTable.Grid for creating table. It can be configured according to need of number of rows and columns.
GWT Grid Class Declaration
Let’s see the declaration of com.google.gwt.user.client.ui.Grid
GWT Grid Constructors
Constructor | Description |
---|---|
Grid() | It is a default constructor for Grid. |
Grid(int rows, int columns) | It constructs a grid with the requested size. |
GWT Grid Methods
Modifier and Types | Method | Description |
---|---|---|
boolean | clearCell(int row, int column) | It replaces the contents of the specified cell with a single space. |
protected Element | createCell() | It creates a new, empty cell. |
int | getCellCount(int row) | It return number of columns. |
int | getColumnCount() | It gets the number of columns in this grid. |
int | getRowCount() | It returns number of rows. |
int | insertRow(int beforeRow) | It inserts a new row into the table. |
protected void | prepareCell(int row, int column) | It checks that a cell is a valid cell in the table. |
protected void | prepareColumn(int column) | It checks that the column index is valid. |
protected void | prepareRow(int row) | It checks that the row index is valid. |
void | removeRow(int row) | It removes the specified row from the table. |
void | resize(int rows, int columns) | It resizes the grid. |
void | resizeColumns(int columns) | It resizes the grid to the specified number of columns. |
void | resizeRows(int rows) | It resizes the grid to the specified number of rows. |
GWT GRID Example 1
//SimpleGrid1.java
Output:
GWT GRID Example 2
//SimpleGrid2.java
//SimpleGrid2.css
Output:
Next TopicGWT FlexTable