0

In my Java project, I'm using the JFrame Form design panel to do a JTable for showing the data from a MySQL database.

The problem is that the table doesn't show all the rows from the database. In fact, it only shows 5 rows. I don't know if I have to change any table property.

tablaUno.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null},
            {null, null, null, null, null, null, null}
        },
        new String [] {
            "RUT", "Nombre", "Apellido", "Edad", "Cargo", "Sexo", "Extrangero"
        }
    ));
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Adrián
  • 19
  • 1
  • The problem is likely in the code which adds rows to your TableModel. Edit your question and show us that code. – VGR Dec 21 '21 at 14:31
  • See: https://stackoverflow.com/questions/55627828/how-to-get-a-defaulttablemodel-objects-data-into-a-subclass-of-defaulttablemode/55635012#55635012 for the basic structure of the code for loading data from a database table to a JTable. – camickr Dec 21 '21 at 15:09

0 Answers0