Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AbstractTreeModel Example

 
Sidharth Pallai
Ranch Hand
Posts: 134
Hibernate Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I need to extend AbstractTreeModel class, can anyone please help me with an example code/idea for the same.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
google is broken?
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need to extend AbstractTableModel ? Usually you should be using the DefaultTableModel
Recommended reading http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
 
Sidharth Pallai
Ranch Hand
Posts: 134
Hibernate Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could not find relevent examples on Google for the same as all the examples are pointing to the use of DefaultTreeModel.


I need to build a generic tree model , not by using DefaultTreeModel , because i need to implement some customized methods to add/remove the tree nodes dynamically from the model which i found AbstractTreeModel as such overidden methods which suits my requirements , so am looking at some implementation examples which uses the AbstractTreeModel.



Thanks.
 
Sidharth Pallai
Ranch Hand
Posts: 134
Hibernate Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Why do you need to extend AbstractTableModel ? Usually you should be using the DefaultTableModel
Recommended reading http://java.sun.com/docs/books/tutorial/uiswing/components/table.html


I have asked for AbstractTreeModel and not AbstractTableModel !!
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My bad.
But there is nothing like an AbstractTreeModel in the standard java library
 
Rok Ć telcer
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AbstractTreeModel doesn't exists ...
edit: Google
--> AbstractTreeModel
 
Sidharth Pallai
Ranch Hand
Posts: 134
Hibernate Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Folks,

Since there was similar model class for Table, i was looking out for Tree.
 
Sidharth Pallai
Ranch Hand
Posts: 134
Hibernate Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Interestingly, i found something from http://java.sun.com/products/jfc/tsc/articles/jtree/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic