The error told you what is the issue. You are using
GridBagConstraints cons = new GridBagContraints();
instead of
GridBagConstraints cons = new GridBagConstraints();
And again in case of TitledBorder you have to import the required api
import javax.swing.border.TitledBorder