Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • 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: 17309
11
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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!