Java Basic Problems

Java:How to count the number of JTable row and column?

If you want to count the number of Row and Column of your JTable,then just add the below lines in your code

 int noc=table.getColumnCount();

 int nor=table.getRowCount();

 System.out.println(“Row:”+nor);

Here table is the name of the JTable you declared in your code.

 Also you can see “How to add data in JTable without using TableModel

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s