views:

727

answers:

3

Hi,

  1. I'm new to netbeans I played around with matisse gui editor and would like to delete a buttonGroup with no reference. I tried the refactor/safe delete action but no way to do so!! That so bad. Is there a trick or do I have to re-start everything?

2.By the way I find it so crazy not to be able to edit the generated grey source code there must be a trick or something..? How do java hardcore gui developers handle this then?

Thanks for your help!

SR

+2  A: 
  1. For the components that you are not able to see in GUI builder, take a look at "Inspector" window, right click on the component and click on delete. The window should be to the left-bottom of your screen by default.

  2. It's a trade off IMHO :) You get the great GUI builder and you are not allowed to arbitrarily change the generated code. Since it will cause the GUI builder not to understand the code. For the common task like specifying parameter to constructor of component at object creation, you can always go to 'Code' group at 'Properties' window. There are some other options such as 'Pre-creation Code' and 'Post-creation Code' too :)

Image: http://lh5.ggpht.com/_5XDoB4MglkY/SYSIp5flFaI/AAAAAAAAE-E/ZIR4ZBLPUz4/s800/NB2.jpg

m3rLinEz
A: 

Doesn't work - there is no delete option. Having it selected and going to Edit -> Delete does nothing.

It works for me. Sure you're doing exactly what m3rLinEz said?
Michael Myers
+1  A: 

I had the same problem, it turns out i was trying to delete it from the wrong window pane.

I was in the 'Navigator' pane rather than the 'Inspector' pane, if you highlight the button group or any other invisible component here in Netbeans and hit DELETE then it will delete it without problems or leaving unecessary code in the Source view.

Hope this helps anyone who might come across this problem again!

Chuteuk