Replies: 2 comments 1 reply
-
I think you are looking for "lazy variable and statement generation" Which delivers this code:
|
Beta Was this translation helpful? Give feedback.
-
Another option is to use a layout that is not so chatty. For example, GridLayout or MigLayout.
You are more than welcome to take a stab at this We will help you get started. This would require the following:
|
Beta Was this translation helpful? Give feedback.
-
Dear WindowBuilder developers.
When we use GroupLayouts in WindowBuilder, it makes a huge code mess that is hard to read. It is especially difficult when there are tons of components, such as JPanels and Tabs, etc.
I suggest adding an option in:
Windows -> Preferences -> WindowBuilder -> Swing -> Code Generation
That will be called: "Generate layouts into a separate method from the rest of the code"
When this option will be turned on, the window builder should generate any layout managers (such as GroupLayout and others) into a separate method called: layoutInitializer().
Then method layoutInitializer() will be called inside the constructor of the JFrame same as initialize().
Of course, in such scenario most of the JPanels and other components somehow related to GroupLayout will have to be field as well as the GroupLayout itself in order for this to work.
There are several benefits to this;
It will be easier to read the code.
It will save time for all developers, especially for new developers.
It will look nicer and easier to manage the code.
I adore WindowBuilder, but I do feel like this feature is very much needed and that it will be taken into consideration.
Example of what I mean:
This is the current situation:
`public class ExampleCurrent {
}`
This is what I would like this feature to do:
`public class ExampleDesired {
}`
Beta Was this translation helpful? Give feedback.
All reactions