how to edit grayed out area of GUI in NetBeans?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Phill64
    New Member
    • Aug 2009
    • 3

    #31
    I've found a workaround, but still looking for a better way.

    Telling you my workaround may help you figure out what's wrong. All this talk of classpaths in netbeans got me worried, especially since the classpaths of the form seem to be readonly? so i copied my .jar file and loaded it into the project from within the classes folder of that project, i can now drag components from there, onto my form with no hassles.

    I don't like this solution though, I'd much rather it link to my project the way it's meant to, so that when I make changes they'll apply without me having to copy the file over. I see no reason why I shouldn't be able to reference the project or reference the jar file where it is compiled, but neither work. only nested within the project does the GUI recognise these types.

    Any idea's of what on earth is going on here? as previously mentioned, the actual code has always worked fine, i can manually code in a class and it will work, but cannot drag it onto the form using the designer.

    Comment

    • Phill64
      New Member
      • Aug 2009
      • 3

      #32
      Ok I also found an article on how to edit the gray blocks here http://stackoverflow.com/questions/4...n-netbeans-6-5

      Comment

      • h3rne
        New Member
        • Oct 2009
        • 1

        #33
        I'm a total netbeans noob - but thanks to everyone who contributed - I finally managed to put the pieces together to delete an action listener/event handler pair I didn't want, without messing with the generated code.

        Here's my walk though for the other noobs out there:
        - Click on the GUI element in design view.
        - Bring up the Properties window from the Window menu on the main menu bar, if it's not already visible.
        - The properties window has four tabs across the top (except they don't really look like tabs. "Properties , Binding, Events, Code" Probably the Properties one is selected by default, and it looks like a button.
        - Click on the "Events" tab. It should change to look like a button.
        - There the first line should be "Action Performed". Next to it should be something other than <none> above a whole load of other buttons showing <none>.
        - On the far right is a [...] button. Click it.
        - In the dialog that appears, click the text for the handler you're trying to remove.
        - Click the "remove" button

        Feel free to check the source code for the GUI, but both the addlistener and eventhandler code should be gone.

        I hope someone finds this useful!

        Comment

        • Vuccli
          New Member
          • Jan 2010
          • 1

          #34
          Gray code IS editable

          Hi all!
          I wish to write it down here, hoping that it will be useful for some guys (because it took me 1-2 hours to realize it, and we know, time is expensive) that gray code in Netbeans GUI builder IS editable!

          Every generated code is attached to some element on the GUI. If you want to change some code, you just have to go to the participated element's Properties window, there switch to Code option, and there you can override EVERY gray code that you wish (if you now what is it for, of course.. because you choose the overriden code like "pre-creation code" or "post init code" and so on)

          Netbeans just make sure, that you know what you doing. Simple and safe :) wow

          (the actionlistening also editable, Properties Event option, as wrote down before me)

          I wrote this down, because i'd just started to hate Netbeans, before i figured this out, and that would be unfair..

          Hope this help!

          Comment

          • Chanbre
            New Member
            • Jul 2010
            • 2

            #35
            I have been wanting to delete an ActionListener for a while but it was referenced in a grey area of code.

            As a novice with Netbeans I think part of the problem is the Netbeans help pages. The section on "Safely Deleting Java Code" discusses "References to selected elements were found" but only gives part of the way of deleting these references.

            It would be most helpful if something based on the words posted by h3rme on 24 Oct 2009 were added to the "Safely Deleting Java Code" help page.

            Comment

            • tezzer
              New Member
              • Oct 2011
              • 1

              #36
              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

              Comment

              Working...