public static void main(String[] args) { MainFrame dialog = new MainFrame(); dialog.pack(); dialog.setVisible(true); }