Results 1 to 6 of 6
  1. #1
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default [SOLVED] Turn off NetBeans code blocker

    I'm curious if there's a setting I can uncheck within netbeans to allow me to alter the generated code that gets created when using the GUI creator? It's fine for laying out everything but when it comes time to work the backbones in I want to be able to do that myself.
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

  2. #2
    markw8500's Avatar
    markw8500 is offline Senior Member
    Join Date
    Jul 2008
    Location
    Pennsylvania, USA
    Posts
    136
    Rep Power
    0

    Default

    I don't think that you can turn it off... But I did some playing around and if you go into the directory where the source files are, there will be a xml file there... If you simply rename that file, close your class and reopen it, NetBeans will treat it like a normal class... Then if you want to put it back into the GUI Builder, just change the name back...

    The syntax of the xml file will be YourClassName.form...
    Last edited by markw8500; 05-01-2009 at 05:58 PM.
    Who Cares... As Long As It Works...

  3. #3
    Gudradain is offline Member
    Join Date
    Nov 2008
    Posts
    44
    Rep Power
    0

    Default

    You can just do the coding that you didn't want to be generated in another method. For example :

    Java Code:
    public class TestFrame extends javax.swing.JFrame {
    
        /** Creates new form TestFrame */
        public TestFrame() {
            initComponents();  //Generated code
            initComponents2(); //Your code
        }
    
    }
    Something wrong with that?

  4. #4
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default

    actually I found this cool little customize code button that lets me put a method call right where I declare one of the Swing components and from that method I can easily manipulate that piece.(Essentially what Gudradain said except I needed to know how to put the method call in there to begin with)
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

  5. #5
    Gudradain is offline Member
    Join Date
    Nov 2008
    Posts
    44
    Rep Power
    0

    Default

    Hmmm, I don't really like the customize code button. Why? You only get error message when you look at the generated code in the source (you don't get them while you are typing in the customize code). Also, if you want something on one component you have to open the customize code for this component specifically. Might be a waste of time if you just have to change a little something on many components.

  6. #6
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default

    That's exactly how I felt but for simple stuff that I shouldn't really be getting confusing errors on it works. I can just copy the generated code into eclipse for the more complex stuff.
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

Similar Threads

  1. Replies: 9
    Last Post: 12-21-2010, 02:37 PM
  2. Turn off sounds in Eclipse
    By gio.fou in forum Eclipse
    Replies: 2
    Last Post: 09-06-2008, 08:31 PM
  3. whats the code that we need to connect oracle10g with the netbeans
    By katko0ota in forum Enterprise JavaBeans (EJB)
    Replies: 6
    Last Post: 07-15-2008, 05:52 PM
  4. turn off auto compile
    By bugger in forum Eclipse
    Replies: 3
    Last Post: 01-04-2008, 08:12 PM
  5. Replies: 9
    Last Post: 12-18-2007, 09:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •