I used the design palette in Apache Netbeans to design a gui application. I have modified much of the code to suit my needs but some remains pure copy and paste. Am I allowed to use the autogenerated code in a commercial application? If yes, do I need to disclose something in the source code or how does it work?

  • 2
    What license applies to the code generated by Netbeans? Note this is a different question from "what is the license of Netbeans itself". Commented Oct 11, 2023 at 13:47
  • Interestingly, the comment in opensource.stackexchange.com/questions/10289/… implies the ownership of autogenerated code hasn't been really tested
    – Martheen
    Commented Oct 11, 2023 at 15:46
  • "Ownership" would imply "ownership of the copyright", which is not the case for AI generated code. Copyright is restricted to works produced by humans. The question here is if this "auto-generated" code was really auto-generated, or that it's just a snippet library from which OP copied parts.
    – MSalters
    Commented Oct 12, 2023 at 15:38

1 Answer 1


Often, the automatically generated code is your code, because you designed the design (which is often saved as xml or other anyway), and the program converted it into code, i.e. it was a converter.

It is not clear, it depends on the specific case, but even if it is copyrighted by Apache Netbeans, Netbeans is licensed under the Apache 2.0 license which is permissive.

Assuming such a case, what you need to do is meet the basic credit requirements. Of course, if you want to be very correct, it will take some space (note, license, authors, description of changes), but it will not affect your product with any copyleft or non-commercial terms.

Read about Apache 2.0 License here.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.