public void setAppropriateSize() {
		int maxX = 0, maxY = 0;

		m_GraphPanel.setScale(m_fScale, m_fScale);

		for (int iNode = 0; iNode < m_BayesNet.getNrOfNodes(); iNode++) {
			int nPosX = m_BayesNet.getPositionX(iNode); 
			int nPosY = m_BayesNet.getPositionY(iNode); 
			if (maxX < nPosX)
				maxX = nPosX + 100;
			if (maxY < nPosY)
				maxY = nPosY;
		}
		m_GraphPanel.setPreferredSize(new Dimension((int) ((maxX + m_nPaddedNodeWidth + 2) * m_fScale),
				(int) ((maxY + m_nNodeHeight + 2) * m_fScale)));
		m_GraphPanel.revalidate();
	}