To specify a gridbag layout, you create an instance of the GridBagLayout class, which you then associate with the surrounding applet using the setLayout method:
GridBagLayout
setLayout
GridBagLayout gbl = new GridBagLayout(); setLayout(gbl);