There is a little discussion of "what's the difference between automated code and hand code?" here
link.
Okay, I've worked on this over the last couple of weeks, finalized my GUI and then converted my code into what I feel comfortable submitting.
Here is what I did:
1) NetBeans creates external ".form" files along side your java code when you use it for GUI creation. That's obviously not "my own work" and it's not useful outside of NetBeans so I deleted them.
2) It puts comment tags into the source that tells the editor not to allow user edits on the auto-generated code. I got rid of all of those.
3) It likes to use fully qualified package references (e.g. new javax.swing.JPanel()) instead of imports. I stripped out the fully qualified references and used import statements.
4) It puts class scoped component references at the bottom of the source file and I like them at the top, so I moved them there.
At that point the only "evidence" that I used a code generator was in the initComponents() method. So I went through the classes one by one and did the following:
- I found that NetBeans likes to use the default contructor and then modifies the component one method at a time. For example instead of saying 'new JButton("my button"') it would generate 'b = new JButton(); b.setText("my button");' So I consolidated everywhere I could.
- For real small classes, like my online help that simply displays HTML, I got rid of the initComponents() method and put the GUI code directly in the class initializer.
- The order in which components are initialized and added appeared random, so I rearranged the code and commented it so that someone reading it could follow along in a left/right and top/down order initialization path.
- Where I used GridBag I noted in the comments the number of rows and number of columns and then ordered the initComponents code by rows and columns.
If your sitting there thinking, "He just re-ordered code that his IDE generated and it's not his own work" then so be it. I came up with the overal GUI design, I tweaked the screens so that they looked good, I put the logic in the methods that were called when the GUI was "clicked", I simplified the generated code where reasonable and I rearranged and documented the generated code so that it would "be readily understood by junior programmers". That's exactly what I would do in the real world.
So, I guess in the end I'm arguing that I truly don't believe you have to code this project entirely from scratch and you shouldn't be afraid to use NetBeans or any other IDE to help you achieve your goal.
Richard