Footer row in a JTable

前端 未结 8 1541
感动是毒
感动是毒 2020-12-20 22:26

What is the best way to put a footer row into a JTable? Does anyone have any sample code to do this?

The only approach I\'ve thought of so far is to put a special ro

8条回答
  •  温柔的废话
    2020-12-20 22:50

    Try using a second JTable that uses the same column model as your data table and add your footer data to that table. Add the second (footer) table under your original table.

    JTable footer = new JTable(model, table.getColumnModel());
    panel.add(BorderLayout.CENTER, table);
    panel.add(BorderLayout.SOUTH, footer);
    

提交回复
热议问题