TextPanel textPanel = new TextPanel(); container.add(textPanel, BorderLayout.CENTER);
buildUI(getContentPane());
JFrame f = new JFrame("TextXY"); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); TextXY controller = new TextXY(); controller.buildUI(f.getContentPane()); f.pack(); f.setVisible(true);