I have written a class that extends JPanel. Is it possible to use this in the NetBeans GUI Builder and have it survive all of the automatic code generation?
You can use the Palette Manager to add your component to the palette, then you can use it in the GUI builder as you would any other class.
See How can I use a custom subclass of a Swing component? in the NetBeans Wiki.