-
May 22nd, 2012, 01:58 PM
#1
Algorithm for JTree?
Phew..Haven't worked with DevBook in quite some time (laziness sindrome) but i restarted the work and Im determined to do a lot in the next few days. I've made a pretty complicated algorithm that breaks down on this line
if(!node.getParent().isRoot&&!node.isLeaf())
The fist thing to notice is that the code won't compile, as getParent() doesen't seem to return a DefaultMutableTreeNode.
I don't know much about casting, but i know it basically works like a general toString() method (correct me if I'm wrong) so I tried
if(!node.getParent()(DefaultMutableTreeNode).isRoot&&!node.isLeaf())
Since I'm here that didn't work either
Now, I know you might ask for more code but trust me, there is nothing else to show..
As a last clarification: I want to make this,node.getParent(), somehow, a compilable expression...
Well..thanks for your time, cheers!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|