This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 34506

Summary: Generate JFrame based classes
Product: guibuilder Reporter: aka3 <aka3>
Component: CodeAssignee: issues@guibuilder <issues>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: ENHANCEMENT Exception Reporter:

Description aka3 2003-06-19 23:01:48 UTC
In the generator that generates a class extending
JPanel I have a suggestion
I prefere the code
    public static void main(String args[]) {
        TestPanel test=new TestPanel();
        test.show();
    }
rather than
    public static void main(String args[]) {
        new TestPanel().show();
    }

Basically the oneline solution is much nicer than
my two line solution.
But what if I want to add a statement before
test.show();
I might want to initialize some data !!!!
This makes me think that it is better to generate
the "two" line code than the oneline compact code.

My situation is that I have made some prototyping
in Swing using NetBeans ... very nice way of working.
But I always needs to replace the oneline code by
a several line version.
Therefore I suggest that the codegenerator is
changed to produce less compact code. 

best regards Anders
Comment 1 ehucka 2003-06-20 08:26:10 UTC
Sources are generated from Templates. You can find them if you go to
"Filesystems" node in Explorer and invoke Customize action. Than find
Defult filesystem and set Hide to false on it.
Now you can see many folders and one of them is Templates. In the
Templates you can find your classes (JFrame, JPanle etc.). You can
change them and try to invoke action New from template on your
package. You will see your change in new generated classes.
Comment 2 ehucka 2003-06-20 08:35:17 UTC
My mistake. I set it as Fixed but I better set it as Invalid. Because
you can customize behaviour of IDE by your way and Templates I think
will not be changed.
Comment 3 ehucka 2003-06-20 08:36:25 UTC
You can reopen it if you think that Templates chould be changed.
Comment 4 Jan Lahoda 2003-06-20 09:19:23 UTC
Hi Anders,
    you can customize the templates by going into:
Tools/Options and here: Source Creation and Managment/Templates. Here
you can choose the template, and choose "Edit" from the context menu.

On the other hand, I think it is valid to propose changes to default
settings of the IDE (note: this does not mean that I think it has to
be applied, I only think it should be analysed). I am reopening the
issue, and asking for evaluation.
Comment 5 Tomas Pavek 2003-07-25 16:35:13 UTC
I have no strong opinion about this. It could be done the way Anders
suggest...