Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Change in formatting for Windowbuilder?(Has there been a change of how the windowbuilder addon creates code or is there a way to change it )
Change in formatting for Windowbuilder? [message #1842926] Tue, 06 July 2021 14:57 Go to next message
ree weeen is currently offline ree weeenFriend
Messages: 1
Registered: July 2021
Junior Member
So I recently downloaded eclipse and windowbuilder on a new machine and for some reason window builder creates different code on the new machine compared to the old one.

I use the same JDK and Eclipse version (JDK16 and Eclipse 2021-06) on both machines.

Is there a way to change the way the windowbuilder addon creates/formats code?

Here is an example of how code is generated on the old machine vs the new one.

Here is the code for a created jButton:

Old machine:

private JButton getBtnNewButton(){
       if(btnNewButton == null){
           btnNewButton = new JButton("New Button");
           btnNewButton.addActionListener(new BtnNewButtonActionListener());
           btnNewButton.setBound(178, 63, 85, 21);
       return btnNewButton;

new machine:
JButton btnNewButton_1 = new JButton("New button");
btnNewButton_1.setBounds(25, 186, 89, 23);

Is there a way to change the way windowbuilder creates/formats the code or do I have to get used to the way windowbuilder does it on my new machine
Re: Change in formatting for Windowbuilder? [message #1842958 is a reply to message #1842926] Wed, 07 July 2021 19:01 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7292
Registered: July 2009
Senior Member

Your snippet does not substantiate any criticism of WindowBuilder

Since the new snippet avoids an "if", it is quite possible that the WindowBuilder code generation has got smarter and so probably better, but clearly different.

If indentation has changed that is probably down to some save / formatting preferences rather than WindowBuilder.

Bottom line: newer tools often have changes, usually improvements, but sadly occasionally regressions. If you have a clear regression, please provide a full repro and submit a Bugzilla.


Ed Willink
Previous Topic:the server selected protocol version tls10 is not accepted by client preferences tls12
Next Topic:How long will it take to learn Java?
Goto Forum:

Current Time: Sun Oct 24 19:13:34 GMT 2021

Powered by FUDForum. Page generated in 0.02061 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top