Organization of codes generated by Windowbuilder

Asked

Viewed 167 times

1

I’m using Windowbuilder to draw the graphical interface, but there’s one thing that’s kind of boring about it, and that’s this. When I create a Jlabel for example, it declares the Jlabel inside the constructor, making it impossible for me to use it directly in other methods. Would there be some way that automatically everything I created would go directly to the class, get organized at the top, so I don’t have to do it manually with every component I have to manipulate in more than one class?

  • The strange thing is that some components it creates directly in the class, instead of the constructor method, such as Jtextfield.

1 answer

1


I found the solution, if someone prefers that the components are declared were from the constructor, can make the following configuration:

In the eclipse go to the WINDOW tab > PREFERENCES > WINDOWBUILDER > SWING > CODE GENERATION and in the window that is written: variable Generation, just select Field, and then press ok.

  • 1

    Very useful information. I didn’t know this menu.

  • Well, I always refused to use the dirty Wb of the disorganization of the codes, but after I discovered that there was much better.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.