Já a classe do programa principal, que irá abrir a FormCadastro, terá o método main que inicia o programa:
package modulo1; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; public class ExemploGridLayout { /** * @param args */ public static void main(String[] args) { JFrame frm = new JFrame("Exemplo de GridLayout"); FlowLayout flow = new FlowLayout(); frm.setLayout(flow); frm.setVisible(true); JLabel lbl = new JLabel("Aperte o botão abaixo para abrir o formulário"); frm.add(lbl); JButton but = new JButton("Aperte aqui"); frm.add(but); frm.setSize(350,200); frm.pack(); frm.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e){ System.exit(0); } }); but.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ FormCadastro form = new FormCadastro(); form.setVisible(true); } }); } }