- Messages
 - 5,508
 
- Reaction score
 - 35
 
- Points
 - 48
 
I am trying to make a JXTreeTable in java, but I don't really know how to build the models.
I have an ArrayList<Location> countries; list filled with Country objects. This list should be the root. In every Country object there is an ArrayList<Location> regions; list filled with City objects. This list should be chilren to countries and parent to the ArrayList<Location> cities; list in all Region onjects that is filled with City objects. Country and Region has a getList() method that returns the list in the object.
I have tried making something out of DefaultTreeTableModel and DefaultMutableTreeTableNode, but all I've achived was an empty table...
Any ideas?
Edit: Nah nevermind managed to solve it
			
			I have an ArrayList<Location> countries; list filled with Country objects. This list should be the root. In every Country object there is an ArrayList<Location> regions; list filled with City objects. This list should be chilren to countries and parent to the ArrayList<Location> cities; list in all Region onjects that is filled with City objects. Country and Region has a getList() method that returns the list in the object.
I have tried making something out of DefaultTreeTableModel and DefaultMutableTreeTableNode, but all I've achived was an empty table...
Any ideas?
Edit: Nah nevermind managed to solve it
			
				Last edited: