How to create a simple JTable component?
The code snippet presented below shows you how to create a simple
JTable component in a swing application. To create a
JTable component we initializes it using the constructor that accept two parameters.
The first parameter is the table's row of data which type is
Object, a two-dimensional array of
Object. The second parameter is the table's column names which type is
Object, an array of object.
JTable instance is created we places it inside a scroll pane component which in turn is added to the frame's content pane.