• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rows and Columns in JTable according To Search Results

 
Anurag Mishra
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
How the JTable can grow and shrink according to the search results obtained by criteriaFind() method.How to get rows and columns according to search results.Help me out
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try looking at the AbstractTableModel class, and extending it. You new table model, can have a setData(DataInfo[] results) method, or as a constructor, and pass the results from criteriaFind. In the new model class, you override some of the the methods to get it to display the columns and rows. As far as the size of the JTable, I think it should always remain the same size, and if the data is more than what can appear, make scrollbars show up
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic