java Netbeans 中的设计视图无法加载
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11057029/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Design view in Netbeans won't load
提问by Isaac
I started to learn swing and downloaded netbeans to work through the tutorials. Unfortunately, when I create a JFrame design view hangs instead of loading and the Navigator and Inspector panes just show up empty.
我开始学习 Swing 并下载了 netbeans 以完成教程。不幸的是,当我创建 JFrame 时,设计视图挂起而不是加载,并且导航器和检查器窗格显示为空。
System details:
Linux Mint Maya
Netbeans version 7.0.1
java 1.6.0_24
Any ideas would be greatly appreciated.
任何想法将不胜感激。
采纳答案by trashgod
In whatever editor/designer you choose, consider the approach shown here, in which the top-level containeris created manually and one or more content panels are maintained in the designer.
回答by Andy Dingfelder
look in the Netbeans View menu and choose "IDE log" There may be an error message / exception there, that might give you a clue.
查看 Netbeans View 菜单并选择“IDE log”那里可能有错误消息/异常,这可能会给你一个线索。
回答by Ste Griffiths
For me, this was caused by a "FormGuardedBlockError", because at one point in my project I copied all of the source out into Notepad++ and used that to replace the .java
file, thereby stripping all of the //GEN-BEGIN
and related directives.
对我来说,这是由“FormGuardedBlockError”引起的,因为在我的项目中,有一次我将所有源代码复制到 Notepad++ 中,并用它来替换.java
文件,从而剥离了所有//GEN-BEGIN
相关指令。
You can close NetBeans, open the .java
file in a plaintext editor and put these directives back by hand, but it may be easier to merge with an earlier version of your code (if you have one).
您可以关闭 NetBeans,.java
在纯文本编辑器中打开文件并手动放回这些指令,但与早期版本的代码(如果有的话)合并可能更容易。
For more details, check out http://wiki.netbeans.org/FormGuardedBlockError
有关更多详细信息,请查看http://wiki.netbeans.org/FormGuardedBlockError
回答by Timtahaney
Menu->view->show edit toolbar fixed this for me , of course the file you select to edit must have jframe, added to it I think for design tab to appear.
菜单->视图->显示编辑工具栏为我修复了这个问题,当然你选择编辑的文件必须有jframe,我认为添加到它以显示设计选项卡。
回答by Janaka Bandara
Go to Menu -> Option -> Select "Java" from option windows tool then Active
转到菜单 -> 选项 -> 从选项窗口工具中选择“Java”,然后选择“活动”