public void loadPrefs()
    {
        final File file = new File("prefs.prf");
        if (!file.exists()) // if the file doesn't exist, set some hard-coded defaults and return
        {
            // DEFAULTS
            m_mapChatSplitPane.setDividerLocation(0.7);
            m_mapPogSplitPane.setDividerLocation(150);
            m_windowSize = new Dimension(800, 600);
            final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            m_windowPos = new Point((screenSize.width - m_windowSize.width) / 2,
                (screenSize.height - m_windowSize.height) / 2);
            m_bMaximized = false;
            getGametableCanvas().setPrimaryScroll(getGametableCanvas().getPublicMap(), 0,0);
            getGametableCanvas().setZoom(0);
            applyWindowInfo();
            addMacro("d20", "d20", null);
            m_showNamesCheckbox.setSelected(false);
            m_randomRotate.setSelected(false); //#randomrotate
            m_actingFileMacros = new File("macros.xml");
            try
            {
                if (m_actingFileMacros.exists())
                {
                    loadMacros(m_actingFileMacros);
                }
            }
            catch (final SAXException se)
            {
                Log.log(Log.SYS, se);
            }
            return;
        }

        // try reading preferences from file
        try
        {
            final FileInputStream prefFile = new FileInputStream(file);
            final DataInputStream prefDis = new DataInputStream(prefFile);

            m_playerName = prefDis.readUTF();
            m_characterName = prefDis.readUTF();
            m_ipAddress = prefDis.readUTF();
            m_port = prefDis.readInt();
            m_password = prefDis.readUTF();
            getGametableCanvas().setPrimaryScroll(getGametableCanvas().getPublicMap(), prefDis.readInt(),
                prefDis.readInt());
            getGametableCanvas().setZoom(prefDis.readInt());

            m_windowSize = new Dimension(prefDis.readInt(), prefDis.readInt());
            m_windowPos = new Point(prefDis.readInt(), prefDis.readInt());
            m_bMaximized = prefDis.readBoolean();
            applyWindowInfo();

            // divider locations
            m_mapChatSplitPane.setDividerLocation(prefDis.readInt());
            m_mapPogSplitPane.setDividerLocation(prefDis.readInt());

            m_actingFileMacros = new File(prefDis.readUTF());
            m_showNamesCheckbox.setSelected(prefDis.readBoolean());

            // new divider locations
            m_chatPanel.setChatSplitPaneDivider(prefDis.readInt());            
            m_chatPanel.setUseMechanicsLog(prefDis.readBoolean());
            
            prefDis.close();
            prefFile.close();
        }
        catch (final FileNotFoundException ex1)
        {
            Log.log(Log.SYS, ex1);
        }
        catch (final IOException ex1)
        {
            Log.log(Log.SYS, ex1);
        }

        try
        {
            if (m_actingFileMacros.exists())
            {
                loadMacros(m_actingFileMacros);
            }
        }
        catch (final SAXException se)
        {
            Log.log(Log.SYS, se);
        }
    }