getRootPane().setDefaultButton(bOk);
getRootPane().setDefaultButton(okButton);
    private void init() {        createCustomPanel();        bOk = new JButton("OK");        bApply = new JButton("Apply");        bCancel = new JButton("Cancel");        bOk.addActionListener(this);        bApply.addActionListener(this);        bCancel.addActionListener(this);        bApply.setEnabled(false);        /* BUTTONS PANEL */        JPanel buttons = new VerticalStaticJPanel();        buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));        buttons.add(Box.createGlue());        buttons.add(bOk);        buttons.add(Box.createRigidArea(new Dimension(5, 0)));        buttons.add(bApply);        buttons.add(Box.createRigidArea(new Dimension(5, 0)));        buttons.add(bCancel);        JPanel mainPanel = new JPanel();        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));        mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));        mainPanel.add(createShapePanel());        mainPanel.add(Box.createRigidArea(new Dimension(0, 5)));        mainPanel.add(buttons);        getContentPane().add(mainPanel);        getRootPane().setDefaultButton(bOk);    }