Cannot coerce value '2' into type: interface javax.swing.border.Border

You can't use a number for a border. You must use the toBorder() expression function.