I am using WindowBuilder for Eclipse Java.
When I make a button or menu (or something else), it creates fields nested inside the constructor. Is there a way to make them fields and then initialized in the constructor so that I can use them outside the constructor? Thank.
i.e.: FROM
public GUIFrame() {
JMenuBar menuBar = new JMenuBar();
}
TO
public JMenuBar menubar;
public GUIFrame() {
menuBar = new JMenuBar();
}
source
share