maybe this?

Code:
......
        backLabel.setBounds(40,45, 627, 364);
        mainpanel.add(backLabel);
        mainpanel.add(mainhead);
        add(mainpanel);
        SecondComp obj = new SecondComp(mainpanel);
.......