5

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.

System details:  
Linux Mint Maya
Netbeans version 7.0.1  
java 1.6.0_24

Any ideas would be greatly appreciated.

thecodeparadox
  • 86,271
  • 21
  • 138
  • 164
Isaac
  • 625
  • 1
  • 12
  • 30
  • Try an [example](http://docs.oracle.com/javase/tutorial/uiswing/) that _doesn't_ use the GUI designer. – trashgod Jun 15 '12 at 19:34
  • I'm obviously going to work through those but I would like to learn how to use the GUI designer as well, which I can't if I can't get it working. – Isaac Jun 15 '12 at 19:36
  • Use a process of elimination: What happens when try an example that doesn't use the GUI designer? Is all of NetBeans broken on your distribution? Just the GUI designer. Just your code? – trashgod Jun 15 '12 at 19:40
  • Just the GUI designer. I tried a previous example that doesn't use it and it ran fine. The GUI designer generates code which requires me to add a library to the package. I thought that would solve it, but it didn't. – Isaac Jun 15 '12 at 19:48
  • Maybe it is a sign that it is better to learn layout managers and stick to them rather than relaying on GUI designer. :) I would strongly recommend the [TableLayout](http://stackoverflow.com/a/10495928/613495) it is my personal favourite. – Boro Jun 15 '12 at 19:53
  • That may very well be. Either way I'm switching back to eclipse and vim. – Isaac Jun 15 '12 at 19:56
  • 1
    to check for bugtraces on Netbeans pages, maybe this bug is closed, maybe not – mKorbel Jun 15 '12 at 20:02
  • @Yitzchak: The designer requires `GroupLayout`, new in Java 6, but there may be others. – trashgod Jun 15 '12 at 20:05

6 Answers6

3

In whatever editor/designer you choose, consider the approach shown here, in which the top-level container is created manually and one or more content panels are maintained in the designer.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • GUI designers keep metadata; NetBeans uses `.form` files containing xml in the `src` tree. Commit frequently. :-) – trashgod Jun 15 '12 at 21:04
3

look in the Netbeans View menu and choose "IDE log" There may be an error message / exception there, that might give you a clue.

Andy Dingfelder
  • 2,090
  • 2
  • 18
  • 30
1

Reinstalling the nb-javac plugin fixed this issue for me.

I followed the steps here and it resolved my problem.

0

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.

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).

For more details, check out http://wiki.netbeans.org/FormGuardedBlockError

Ste Griffiths
  • 318
  • 5
  • 15
0

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.

0

Go to Menu -> Option -> Select "Java" from option windows tool then Active