2
I’m starting to mess with Jtable but I’m having a doubt. I’m seeing this post here on another forum and my question is. In case it passes to the table template a list of book type:
private List<Livro> valores;
public TitulosTableModel(List<Livro> valores) {
this.valores = new ArrayList<Livro>(valores);
}
But in my example, I have several entities (not using book), student, teacher, discipline etc... I have to make a table model for each entity, or have a way to make the generic table model, to receive a list of any type of object?
I just remembered that I had already answered something similar and finally I found: How do I popular a Jtable?. To my surprise you are the author of the other question as well. Wouldn’t that be the case for a duplicate? If it’s not, please explain the difference because now I’m confused.
– Math
No Math, as popular the table I already know, using Abstracttablemodel, and then in my Tablemodel I get a Student List, what I wanted to know is if I have to create a table model for each type: List of teachers, list of courses... Or if there’s any way I can handle it on the same Tablemodel.
– João Neto
Because when I click on students, I want the list of students to appear, when I click on teacher the same thing... But all using the same Tablemodel.
– João Neto
Ok, got it! I will remove my answer for now as I am running out of time to update, if I update later I undo the deletion. Good luck.
– Math
All right! Thanks Math!
– João Neto