I'm running WindowBuilder 1.22.0.202511270930
When in the design tab, if(Beans.isDesignTime() == true) is ignored, while if(Beans.isDesignTime() is honored.
Why is this?
Here's a simple test case:
import java.awt.BorderLayout;
import java.beans.Beans;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class WbpIssue extends JPanel {
private static final long serialVersionUID = 1L;
private JLabel lbCenter;
private JLabel lbNorth;
public WbpIssue() {
setLayout(new BorderLayout(0, 0));
if(Beans.isDesignTime() == true) {
add(getLbNorth(), BorderLayout.NORTH);
}
if(Beans.isDesignTime()) {
add(getLbCenter(), BorderLayout.CENTER);
}
}
private JLabel getLbNorth() {
if (lbNorth == null) {
lbNorth = new JLabel("North");
}
return lbNorth;
}
private JLabel getLbCenter() {
if (lbCenter == null) {
lbCenter = new JLabel("Center");
}
return lbCenter;
}
}
When you load this into the editor's Design tab, the only label displayed is "Center". The "North" label is not shown.