From: Timothy W. <tw...@us...> - 2004-09-28 12:53:12
|
On Sep 28, 2004, at 8:31 AM, nla...@hs... wrote: > > hi > i placed the expression as u said but its throwing an exception > pls check it out > > > > Error: java.lang.ClassCastException: Cannot cast > com.client.MyTreeCellRenderer to javax.swing.JTree > in step 'icon = ((JLabel)((JTree)component("JTree > Instance").getCellRenderer())).getIcon()' > Fix your parens. You need to cast the result of component("JTree Instance") to JTree, and cast the result of getCellRenderer() to JLabel (assuming you're deriving from DefaultCellRenderer, which is a JLabel). |