JTree and JTable questions
Posted on 2003-11-30
I have a few questions about JTree and JTable:
1) JTree: When extedning DefaultTreeCellRenderer, I often see examples implementing the method
getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus).
When/by what is this method called and what does it do (from Java API: "Configures the renderer based on the passed in components.")?
2) JTree: What is a userObject, received in method getUserObject? (From Java API: an Object provided by the user that constitutes the node's data) What is is really?
3) JTable: I have a JTable and a class implementing TableModel. How are the table celles populated? I want each row to present the attributes of one object in a Vector. Is it the getValueAt(int rowIndex, int columnIndex) method that I have to implement with a switch statement, each column number returns one of the attributes?
Thanks in advance!!