private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) this.getContentPane().setLayout(new BorderLayout(10,10)); buttonsPanel.add(closeButton); mainPanel.add(buttonsPanel, BorderLayout.SOUTH); this.getContentPane().add(mainPanel); nameTF.requestFocusInWindow();