I have this code snippet (originally old code, created without a GUI designer) where the GridBagConstraints are not properly parsed by WindowBuilder:
public MainFrame3()
{
...
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
GridBagLayout layout = new GridBagLayout();
contentPane.setLayout(layout);
...
JButton btnNewButton = new JButton("New button");
layout.setConstraints(btnNewButton, new GridBagConstraints(1, 0, 1, 1, 1.0, 0, GridBagConstraints.WEST,
GridBagConstraints.HORIZONTAL, new Insets(10, 0, 0, 10), 0, 0));
contentPane.add(btnNewButton);
}
The GridBagConstraints properties don't show the correct ANCHOR, FILL and WEIGTHX values and the button is not rendered properly in preview:
Attached is a full sample project - open "MainFrame3.java" in designer:
WindowBuilderSample.zip
I have this code snippet (originally old code, created without a GUI designer) where the
GridBagConstraintsare not properly parsed by WindowBuilder:The GridBagConstraints properties don't show the correct ANCHOR, FILL and WEIGTHX values and the button is not rendered properly in preview:
Attached is a full sample project - open "MainFrame3.java" in designer:
WindowBuilderSample.zip