findWindow.setLocation(findWindow.getOwner().getLocation());
    private void initFindWindow()    {        if (findWindow == null)        {            findWindow = new JDialog(mainWindow, "Hex Editor Find", false);            findWindow.getContentPane().setLayout(new BorderLayout());            findWindow.getContentPane().add(findTA = new JTextArea(5, 30),                BorderLayout.NORTH);            findTA.setLineWrap(true);            findTA.setWrapStyleWord(true);            findTA.setDocument(new PlainDocument()            {                public void insertString(int offs, String str, AttributeSet a)                    throws BadLocationException                {                    if (str == "\n")                        find();                    else                        super.insertString(offs, str, a);                }            });            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();        }    }