findWindow.setLocation(findWindow.getOwner().getLocation());
    private void initFindWindow()    {        if (!findWindowInited)        {            findWindowInited = true;            findWindow = new JDialog(mainWindow, "Text Editor Find", false);            findWindow.getContentPane().setLayout(new BorderLayout());            findWindow.getContentPane().add(findTF = new JTextField(),                BorderLayout.NORTH);            JPanel buttons = new JPanel(new FlowLayout());            JButton findb = new JButton("Find");            findb.setActionCommand("findb");            findb.addActionListener(new ActionListener()            {                public void actionPerformed(ActionEvent ae)                {                    find();                }            });            findWindow.getRootPane().setDefaultButton(findb);            buttons.add(findb);            JButton closeb = new JButton("Close");            closeb.setActionCommand("closefindb");            closeb.addActionListener(new ActionListener()            {                public void actionPerformed(ActionEvent arg0)                {                    findWindow.setVisible(false);                }            });            buttons.add(closeb);            findWindow.getContentPane().add(buttons);            findWindow.pack();        }    }