import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.BorderLayout; public class hello { private JFrame mainframe = null; // @jve:decl-index=0:visual-constraint="142,48" private static JPanel mainwindow = null; public hello() { // look at me. I'm a constructor } /** * This method initializes mainframe * * @return javax.swing.JFrame */ private JFrame getMainframe() { if (mainframe == null) { mainframe = new JFrame(); mainframe.setSize(new java.awt.Dimension(367,173)); mainframe.setTitle("Blah"); mainframe.setContentPane(getMainwindow()); } return mainframe; } /** * This method initializes mainwindow * * @return javax.swing.JPanel */ private JPanel getMainwindow() { if (mainwindow == null) { mainwindow = new JPanel(); mainwindow.setLayout(new BorderLayout()); } return mainwindow; } /** * @param args */ public static void main(String[] args) { hello h = new hello(); h.init(); try { Thread.sleep(100000); } catch(Exception ex) { // actually catch interrupted exception System.out.println("Got an exception"); } } public void init() { this.getMainframe(); this.getMainwindow(); mainwindow.show(); } }