?
Solved

Netbeans Container deletion operation fails to perform properly?

Posted on 2011-10-17
10
Medium Priority
?
247 Views
Last Modified: 2012-06-22
I'm trying to delete a JPanel from my mailPanel under [FrameView] in Netbeans??! When I delete this JPanel it just deletes this from Inspector view, it does not unlink and delete all the components it has auto-generated as a result of creating those controllers inside the JPanel and the JPanel itself and leaves my initial code with all the rubbish that were meant to be deleted. What should I do to safely delete everything associated with this JPanel deletion??! Please help!
0
Comment
Question by:snajalm
  • 5
  • 3
  • 2
10 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 36978356
You haven't by any chance edited auto-generated code have you?
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36978369

http://forums.netbeans.org/ntopic16161.html

Open the inspector and delete the variables there.
This will also delete variables from the code (if you haven't added the
code manually by adding "user defined code" in the UI elements).
0
 

Author Comment

by:snajalm
ID: 36978371
No!  not at all!  Is that possible though??!
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 86

Expert Comment

by:CEHJ
ID: 36978391
>>Is that possible though??!

Well yes, but don't even think about it ;)
0
 

Author Comment

by:snajalm
ID: 36978412
I know but can you please let me know how, because I can see for some reason the action method related to one of my jButtons has become part of encrypted autho-generated field.  I need to turn this feature off for that specific line so that the system is not confused.  I may need to remove that method manually and leave the rest to the automatic delete operation!
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36978420
Go to the inspector and delete the variables associated with jbuttons form there - it should delete the code.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36978421
You don't need to edit it to do that and mustn't. Just set a new Action to the button using your own code. The auto one will be replaced
0
 

Author Comment

by:snajalm
ID: 36978467
I did try to create a new action but it didn't do anything in regards to removing the previous action.  I have included an image file showing what has happened to the event which is pretty awkward.  The auto is confused on which part of this code should be protected and which part shouldn't.  That's why it can't change anything in regards to this controller!
untitled.bmp
0
 

Accepted Solution

by:
snajalm earned 0 total points
ID: 36978487
I got the answer from this link which helped remove the faulty action!

http://bytes.com/topic/java/answers/856301-how-edit-grayed-out-area-gui-netbeans

This is an old topic, but it comes up high in google searches, so here's how I solved the problem:

The original poster was looking to delete event handlers that were automatically created by NetBeans, but that were no longer needed. You can't do this by editing code; you do it through the GUI like so:

1) Go to the "Design" pane and select the component whose handlers you want to remove

2) On the right hand side of the NetBeans screen, look at the "Properties" window, and select "Events"

3) Find the event you want to remove in the list, hit the ellipsis "...", and use the panel that pops up to remove the event handler you don't want anymore. The auto-generated code will be removed.

I found this information here: http://www.qtp.ufl.edu/slaterlab/hpc...e/visual39.htm 
0
 

Author Closing Comment

by:snajalm
ID: 37010502
Many thanks to CEHJ and for_yan for their support!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses
Course of the Month16 days, 12 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question