aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes AbstractTreeModel Example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "AbstractTreeModel Example" Watch "AbstractTreeModel Example" New topic
Author

AbstractTreeModel Example

Sidharth Pallai
Ranch Hand

Joined: Apr 21, 2008
Posts: 134

Hello All,

I need to extend AbstractTreeModel class, can anyone please help me with an example code/idea for the same.


Thanks & Regards
Sidharth Pallai
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
google is broken?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10255
    
    8

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


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Sidharth Pallai
Ranch Hand

Joined: Apr 21, 2008
Posts: 134

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

Joined: Apr 21, 2008
Posts: 134

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

Joined: Jul 26, 2007
Posts: 10255
    
    8

My bad.
But there is nothing like an AbstractTreeModel in the standard java library
Rok Štelcer
Ranch Hand

Joined: Nov 03, 2009
Posts: 101
AbstractTreeModel doesn't exists ...
edit: Google
--> AbstractTreeModel


SCJP, SCWCD
Sidharth Pallai
Ranch Hand

Joined: Apr 21, 2008
Posts: 134

Sorry Folks,

Since there was similar model class for Table, i was looking out for Tree.
Sidharth Pallai
Ranch Hand

Joined: Apr 21, 2008
Posts: 134

Hi All,

Interestingly, i found something from http://java.sun.com/products/jfc/tsc/articles/jtree/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AbstractTreeModel Example