Eclipse 中 javax 包的代码辅助
我正在使用 Eclipse,并且我注意到每当我使用 javax
包下的任何内容时,我都不会在代码辅助中获得可用方法的完整列表。例如:
JFrame frame = new JFrame();
frame. // this will open up code assist window, but the window only has methods
// inherited from type Object, not the methods from JFrame
我使用 jdk1.6.0_25
作为我的 JRE,并且我确保我的源附件和 javadoc 位置对于 rt.jar
是正确的,并且还尝试检查所有内容在窗口 → 首选项 → Java → 编辑器 → 内容辅助 → 高级中。
我对 Eclipse 还很陌生,所以我不确定我可能做错了什么,如果我遗漏了任何其他相关信息,请告诉我,我会将其包括在内。
I'm using Eclipse and I've noticed that I don't get a full list of available methods in my Code Assist whenever I'm using anything under the javax
package. For example:
JFrame frame = new JFrame();
frame. // this will open up code assist window, but the window only has methods
// inherited from type Object, not the methods from JFrame
I'm using jdk1.6.0_25
as my JRE, and I ensured my source attachment and javadoc locations are correct for rt.jar
, and also tried checking everything in Window → Preferences → Java → Editor → Content Assist → Advanced.
I'm pretty new to Eclipse so I'm not sure what I may be doing incorrectly, if there is any other pertinent information that I have left out, let me know and I'll include it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也遇到了同样的问题,然后我自己解决了。
在我的公司中,这两个包下的类很少使用(事实上,并不鼓励它们)。所以预装的 eclipse 只是将它们添加到过滤器列表中。
要解决此问题,请打开“窗口 -> 首选项”并搜索“类型过滤器”(在我的计算机中,它位于 Java-Appearance-Type Filters 中),您将看到过滤包的列表,取消选中“java.awt” .”和“javax.swing。”。
希望这有帮助!
I have encountered the same problem, and then I worked it out myself.
In my company classes under these two packages are rarely used (in fact, they are not encouraged). So the pre-installed eclipse just adds them to the filter list.
To fix this, open "Window -> Preferences" and search for "type filters" (in my computer it is in Java-Appearance-Type Filters), and you would see a list of filtered packages, uncheck the "java.awt." and "javax.swing.".
Hope this helps!
我已经尝试过了,并且在 Eclipse Indigo 中工作得非常好。
javax.swing.JFrameframe = new javax.swing.JFrame();
frame.//这里我得到了所有可用的方法和我应该得到的所有其他东西...所以,请确保你有导入的包...
希望这有帮助!
I have tried this and works perfectly fine in Eclipse Indigo.
javax.swing.JFrame frame = new javax.swing.JFrame();
frame.//here i get all available methods and everything else i am supposed to...So, make sure you have the packages imported...
Hope this helps!