The durationPanel is actually set by line 187: 
durationPanel = createDurationPanel(experiment);

Thus, if you want to change this createDurationPanel to set the durationPanel, this createDurationPanel method needs to be modified accordingly:
a. It doesn't need to return the durationPanel, since the private instance variable durationPanel is already set.
b. Line 187 needs to be changed to the following:
createDurationPanel(experiment);

Anyway, I think it would be better to keep the original design. Since there may be other cases where we need to call createDurationPanel to create a duration panel on the fly instead of set the instance variable directly.