Time for action – displaying posts using the TreeTable component
Let us see how we can display posts using the TreeTable component in the Year/Month/Posts hierarchy.
- Create a root TreeNode and add Year, Month, and Posts child nodes:
public class TreeTableController { private TreeNode root; public TreeTableController() { root = new DefaultTreeNode("Root", null); TreeNode node2013 = new DefaultTreeNode(new PostNode("2013",""), root); TreeNode node2012 = new DefaultTreeNode(new PostNode("2012",""), root); TreeNode node2011 = new DefaultTreeNode(new PostNode("2011",""), root); TreeNode jan2013 = new DefaultTreeNode(new PostNode("Jan",""), node2013); TreeNode feb2013 = new DefaultTreeNode(new PostNode("Feb",""), node2013); TreeNode aug2012 = new DefaultTreeNode(new PostNode("Aug",""), node2012); TreeNode...