Cant see methods of the class
Hello,
I am using NetBeans IDE for development. Problem is that, I cant see the methods of the class. I have imported the required class, I have created its reference as public and static. and I have created its object inside the constructor.
Now, when I type '.' [dot] in front of object created, netBeans displays the list of available methods. But it doesnt show all the methods. What might be the problem? If anything unclear to you, please ask me.
Thanks and regards.
> If anything unclear to you,
What is unclear to me is why you asked this here instead of a NetBeans forum.
Sorry for that. But, I thought that, Many of members of this forum might be using netBeans IDE. So they could solve my problem. Also, Many times I got solutions/guidelines/ideas about the problems/queries I have placed in this forum. That's why I asked my query in this forum. anyway sorry for that.
Regards
May be those methods are private. Are they?
No those methods are not private. In fact I have used the method without any problem. Otherwise built-in compiler tool might throw an error by making that statement red. Only problem is that, I can use it, but I cant see it when I type '.' [dot].
Thanks and Regards.
your qust. is not clear.the possiblities are :
1 if you had used an interface in your class and if you have called the object of that class with the reference of that interface ,IDE will display only the methods declared in the interface.
2.another possibility
(classname)objectOfTheClassName.method();
3.you should call the object reference directly with original class
4. Code completion does simply not work for some reason.
Thanks! Following is the sample code snippet. This class is compiled successfully and also its getting executed very well. I am using this code in my project.
import javax.swing.tree.*;
import javax.swing.*;
import java.io.*;
public class MyTree {
public static DefaultTreeModel model;
public static JTree myTree;
public MyTree() {
DefaultMutableTreeNode root = new DefaultMutableTreeNode("ROOT");
model = new DefaultTreeModel(root);
model.setAsksAllowsChildren(true);
myTree = new JTree(model);
myTree.setShowsRootHandles(false);
JScrollPane jScrollPane3 = new JScrollPane(myTree);
}
}
1) model.setAsksAllowsChildren(true);
No compile time error, No rutime error/exception. But when I type '.' [dot] in front of model, I cant see this method in the list displayed.
2) myTree.setShowsRootHandles(false);
Same case with this also.
i.e. I am using both setAsksAllowsChildren() and setShowsRootHandles() methods, but I cant see them in the dropDownList displayed by typing '.' after corresponding objects i.e model and myTree respectievly.
hope this will clear the problem.
> 1) model.setAsksAllowsChildren(true);
> No compile time error, No rutime
> error/exception. But when I type '.' [dot] in front
> of model, I cant see this method in the list
> displayed.
So what, it's a stupid Netbeans GUI issue. Restart it, it may help. Or ask at a Netbeans forum or mailing list.
Thanks!! I have also placed this in netBeans Forum also. Lets see,
If anyone using NetBeans IDE and having any idea about setting, please tell me.
Regards.
> Thanks!! I have also placed this in netBeans Forum
> also. Lets see,
Oh, so many thanks for not only not asking at the right place right away, but also insisting on taking even more of our time by keeping the question up here while crossposting.
Sorry Once again! My thinking behind posting here is that many Java programmers use NetBeans IDE, and I may get solution here. I 'll take care of that in future.
Thanks and Regards.